After MySQL is installed in Linux, the cause of my. cnf cannot be found and the database is restored from the SQL statement file.

Source: Internet
Author: User

MySQL installed in the rpm package in Linux does not install the/etc/my. cnf file,
As to why MySQL can be started and used without this file, there are two arguments,
The first statement is that my. cnf is only a parameter file during MySQL startup, but it does not exist. In this case, MySQL will start with the built-in default parameter,

Second, MySQL automatically uses the my-medium.cnf file under the/usr/share/mysql directory at startup, which is limited to MySQL installed in rpm packages,

Solution: copy the. cnf file under the/usr/share/mysql directory to the/etc directory and change it to my. cnf.

 

The file backed up with mysqldump is an SQL script that can be directly imported. There are two ways to import data.

Directly use the mysql client
For example:

/Usr/local/mysql/bin/mysql-uyejr-pyejr db_name <db_name. SQL

Use SOURCE syntax
In fact, this is not a standard SQL syntax, but a function provided by the mysql client, for example:

SOURCE/tmp/db_name. SQL;
Here, you must specify the absolute path of the file and the file must be read by the mysqld running user (such as nobody.

Author: "Blue Heart"

Related Article

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.