MySQL中安装样本数据库Sakila过程分享
通常情况下对于一个全新的MySQL服务器,没有任何数据供我们测试和使用。对此,MySQL为我们提供了一些样本数据库,我们可以基于这些数据库作基本的操作以及压力测试等等。本文描述的是安装sakila数据库。该数据库需要安装在MySQL5.0以上的版本。以下是其描述。
1、下载种子数据库
下载位置:http://dev.mysql.com/doc/index-other.html
2、安装种子数据库sakila
[root@localhost~]#unzipsakila-db.zip Archive: sakila-db.zip creating:sakila-db/ inflating:sakila-db/sakila-schema.sql inflating:sakila-db/sakila.mwb inflating:sakila-db/sakila-data.sql Thesakila-schema.sqlfilecontainsalltheCREATEstatementsrequiredtocreatethestructureoftheSakiladatabaseincludingtables,views,storedprocedures,andtriggers. Thesakila-data.sqlfilecontainstheINSERTstatementsrequiredtopopulatethestructurecreatedbythesakila-schema.sqlfile,alongwithdefinitionsfortriggersthatmustbecreatedaftertheinitialdataload.
Thesakila.mwbfileisaMySQLWorkbenchdatamodelthatyoucanopenwithinMySQLWorkbenchtoexaminethedatabasestructure.Formoreinformation,seeMySQLWorkbench. [root@localhost~]#ls anaconda-ks.cfg Desktop install.log install.log.syslog sakila-db sakila-db.zip [root@localhost~]#cdsakila-db [root@localhostsakila-db]#ls sakila-data.sql sakila.mwb sakila-schema.sql [root@localhostsakila-db]#mysql-uroot-p<sakila-schema.sql Enterpassword: [root@localhostsakila-db]#mysql-uroot-p<sakila-data.sql Enterpassword: