Archive for future reference.
1. Download the MySQL free installation version zip package.
2. Decompress MySQL to the directory to be installed (you can decide where to put it ). After decompression, the default folder name is: mysql-6.0.9-alpha-win32 (of course you can change it yourself), and then set mysql_home in the environment variable (in this way, you can later use % mysql_home % to reference the installation directory ). For example, I put it under the root directory of the E disk, so mysql_home is set to: e: \ mysql-6.0.9-alpha-win32
3. open the file my-huge.ini and save it as my. ini, and add the following configuration at the end of the my. ini file (or somewhere else, of course. (My. ini remember to save it in the same directory as the my-huge.ini) (# indicate comments)
[Mysqld]
# Set the installation directory of MySQL
Basedir = E: \ mysql-6.0.9-alpha-win32
# Set the data storage directory of the MySQL database, which must be data or [url = file: // \ XXX-data] \ XXX-data [/url]
Datadir = E: \ mysql-6.0.9-alpha-win32 \ data
4. Add % mysql_home % \ bin to the path environment variable.
5. Execute the command mysqld-install on the command line (CMD. Install MYSQL as a Windows service. (Be sure to run this command in the \ bin directory under the installation directory. Otherwise, problems may occur .)
6. Execute the command: Net start MySQL or find the MySQL service in the Windows Management Tool> service to start.
7. Run mysql-uroot in the command line (the PATH variable can be set in any directory ). You can access the database. After this operation, MySQL installation is complete.
Then go to the password modification process. The actual operation is as follows:
1. Disable running MySQL.
2. Open the DOS window and go to the MySQL \ bin directory.
3. Enter mysqld -- skip-grant-tables and press Enter. If no prompt is displayed, it is correct.
4. Open another DOS window (because the DOS window can no longer be moved) and go to the MySQL \ bin directory.
5. Enter MySQL and press Enter. If yes, a MySQL prompt is displayed.>
6. Connect to the permission database> use MySQL; (> is the original prompt, don't forget the last semicolon)
7. Change Password:> Update user SET Password = PASSWORD ("123456") where user = "root ";
8. Refresh permissions (required steps)> flush privileges;
9. Exit> \ q
10. log out of the system, log on to MySQL, and log on to MySQL with the username "root" and the new password "123456.