After MySQL is installed in Linux, the cause of my. cnf cannot be found and the database bitsCN.com can be recovered from the SQL statement file.
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"
BitsCN.com