Following the normal steps to install MySQL, the default directory for DataDir found is
Copy Code code as follows:
C:\Documents and Settings\All Users\Application Data\mysql\mysql Server 5.1\data
Originally C disk capacity is not much, of course, can not be placed in this ~ ~ so follow the online steps, in the My.ini file has been modified, and then in the "service" inside the restart service, the terrible thing happened, there is a "local computer can not start the MySQL service" error, the sorrow died, had to unload and reload, The problem is the same, non-stop Baidu Google, finally resolved, summed up as follows.
First, login to the MySQL monitor command:
Copy Code code as follows:
CMD >> mysql-u root-p//Then enter the password
Ii. to see where the database is stored on disk:
Copy Code code as follows:
MySQL > Show variables like '%datadir% ';
Go to C disk under this directory to view (hidden folder), sure enough data is there, each database corresponding to a folder, my goal is to change this address to E disk MySQL installation directory of the Data folder, must step carefully, otherwise it is easy to make mistakes.
Third, modify the data storage location
1. Copy all folders under C:\ ' ' \data to the target location e:\ ' \data (do not delete the data files under C disk, so that the error will not be configured later);
2. Open the installation directory of the My.ini file, find this line: datadir= "C:/programdata/mysql/mysql Server 5.5/data/" modified to: Datadir= "E:\MySQL\data", special attention is "\ "Rather than"/", or not succeed (somehow!!! )
3. Quit all calls to Mysql.exe, Task Manager look at the service MySQL has not stopped, if not, in cmd command net stop MySQL service. Then restart the service in net start MySQL
4. Query the database location to see if it was successful
Four, the MySQL crash solution
In order to modify the data storage location (default in C disk), I privately modified the my.ini inside a word, the result of direct MySQL service can not start, even Mysqld.exe also directly crashes, root users also login not to go in, reset instance Config directly in the start service one step infinite card die ... Finally try the first step in instance config to choose Remove existed instance, and then reset it again, in the last start of patience, finally back to normal. omg~