MySQL usage summary (in continuous update with amp; hellip;) bitsCN.com
Purpose
I have encountered and solved some problems using mysql. I will record and share them here.
Problem 1: when installing mysql in Linux source code, the innodb storage engine is not installed by default and needs to be manually installed.
If you forget to manually install innodb, mysql selects myisam as the storage engine by default when any table is created and does not report any error or warning, in this way, the problem may be concealed. Because some business logic may be implemented based on foreign key constraints, and myisam storage engine does not support foreign key constraints, the implementation of these business logic will be problematic.
Manual installation of innodb reference link: http://www.cnblogs.com/bourneli/articles/2632171.html
Question 2: The SQL files exported by mysqldump are sorted alphabetically by the table rather than by dependency.
Because it is easy to break through the original dependency order between database tables in alphabetical order, an error is returned if the foreign key dependency constraint is broken during data import. Therefore, when importing data, you need to disable the foreign key constraint and enable it after the import is complete. In this way, the import speed will be faster. The following column:
Set FOREIGN_KEY = 0; // close foreign key constraint // import your dataset FOREIGN_KEY = 1; // open foreign key constraint
Http://stackoverflow.com/questions/1382583/foreign-key-constraints-while-dumping-data for this question
BitsCN.com