It's been a long time since I started using MySQL database because of my job needs. The basic has been forgotten almost. Today reinstall configuration, write an essay record, lest oneself later need to look over, if there is not correct or need to add, I hope we have a lot of messages.
First download MySQL, I directly through the Baidu software download "mysql-5.6.24-win32.1432006610" version
After the download is complete. I'm going to unzip to the C drive. Then, the name of the modified folder is "MySQL" and the directory structure is as follows
In the root directory, there is a file named "My-default.ini", modified to. ' My.ini ', which is also convenient after the configuration of the time, less a little word. Steal a Lazy ~
Open this configuration file, originally for
Will draw the place of the red box, the front "#" removal , must be removed, otherwise MySQL can not read this configuration, and then, will Basedir and DataDir, write your installation directory, otherwise after service no way to start
When you're done modifying, close the file and start setting up environment variables.
Right-click the advanced system settings, properties, My Computer, click the New button under System variables
Click New to pop up the confirmation box
Input variable name: mysql_home
Input variable value: MySQL installation directory, this is C:\mysql.
OK, save
Then find the path in the environment variable, select, click the Edit button
In the end add;%mysql_home%\bin;
Note: The variable value is appended with this variable, separated from it, and the original variable value cannot be deleted.
---------------------------------------------------------------------------------------------------------
After the change, the preparation is ready, and then you can start the installation.
Enter the familiar black box, cmd
CD MySQL installation directory, then enter mysqld--install mysql--defaults-file= "C:\mysql\my.ini" Enter
Prompt service installation succeeded
MySQL is still not available at this time because after the installation, the service is started
Input net start MySQL
Here to post, stop and unload the commands
Start, stop, and uninstall of MySQL service
Startup: net start MySQL
STOP: net stop MySQL
Uninstall: SC Delete MySQL
Note: Error 2 and error 1067 often occur at this time.
If the "Error 2 system cannot find a file", check whether the configuration file has been modified or whether to enter the bin directory, if the configuration file is correct and enter the Bin folder, you need to remove MySQL (input mysqld-remove) and then reinstall (Input mysqld- Install);
If error 1067 occurs, it is a configuration file modification error, verify that the configuration file is correct.
PS: After the service started successfully, you can log in, enter Mysql-u root-p (no password for the first login, press ENTER directly)
MYSQL installation Configuration