MySQL usage summary (continuously updating & hellip;) _ MySQL

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.