After installing mysql according to the normal steps, it is found that the default directory of datadir is
Copy codeThe Code is as follows: C: \ Documents ents and Settings \ All Users \ Application Data \ MySQL Server 5.1 \ data
Originally, the C disk capacity was not much. Of course, it cannot be placed in it ~~ Therefore, follow the online steps in my. the INI file was modified and the service was restarted in the "service". The terrible thing happened, and the error "the local computer cannot start Mysql service" occurred, I had to uninstall and reinstall it. The problem was still the same. Baidu and Google had finally solved the problem, which is summarized as follows.
1. log on to the mysql monitor command:
Copy codeThe Code is as follows:
Cmd> mysql-u root-p // then press enter to enter the password
2. Check the storage location of the database on the disk:
Copy codeThe Code is as follows: mysql> show variables like '% datadir % ';
Go to the directory under drive C to view (hidden folder). The data exists here, and each database corresponds to a folder, my goal is to change this address to the data folder under the mysql installation directory of the E disk. Be sure to proceed with caution. Otherwise, errors may occur easily.
3. Modify the data storage location
1. copy all the folders in C: \ ''''' ''' \ data to the target location E: \ ''' \ data (do not delete the data files on drive C to avoid errors in future configuration );
2. open my. INI file, find this line: datadir = "C:/ProgramData/MySQL Server 5.5/data/" changed to: datadir = "E: \ MySQL \ data ", special attention is "\" rather than "/", otherwise it cannot be successful (somehow !!!)
3.exit all calls to mysql.exe. The task manager checks whether the MySQL service has stopped. If not, run the "net stop mysql" command in cmd to stop the service. Then restart the service in net start mysql.
4. query the database location and check whether the database is successful.
Iv. Solutions to mysql crash
The slave database crashes directly, and the root user cannot log in. Resetting instance config directly causes an infinite number of failures at the start service... Finally, I tried to select remove existed instance in the first step of instance config, and then reset it again. At the end of the start, I was patient and finally recovered to normal .. OMG ~