# Configuration environment: Windows 64bit
# Installed version: Mysql-5.7.10-win32 (Zip archive version)
1. ZIP version Archive is free to install, simply unzip the mysql-5.7.10-win32.zip to the installation directory.
2. Under the D:\Program Files\mysql-5.7.10-win32 folder, create a new configuration default file My.ini, in which you need to configure character encoding. The file replaces the My-default.ini file under the folder (the. ini file is a configuration file inside windows that holds various default data).
The contents of My.ini are as follows:
[Mysqld]
Port = 3310
Basedir = D:\Program Files\mysql-5.7.10-win32
DataDir = D:\Program Files\mysql-data-5.7.10\data
Socket = D:\Program Files\mysql-data-5.7.10\mysql.sock
Log-error = D:\Program Files\mysql-data-5.7.10\logs\mysqld.log
Max_connections = 200
Character-set-server = UTF8
Default-storage-engine = INNODB
Lower_case_table_names = 1
Sql_mode = No_engine_substitution,strict_trans_tables
#skip-grant-tables
[Client]
Port = 3310
Default-character-set = GBK
[MySQL]
Default-character-set = UTF8
[Winmysqladmin]
D:\Program Files\mysql-5.7.10-win32\bin\mysqld.exe
3. Create a log storage folder
Log path: D:\Program files\mysql-data-5.7.10\logs
4. Run the command prompt as administrator, switch directories to the D:\Program Files\mysql-5.7.10-win32\bin folder
5. Install the MySQL service and enter the command:
Mysqld--install MySQL--defaults-file= "My.ini"
If the installation is successful, the following prompt appears: Service successfully installed.
6. Initialize the service and enter the command:
Mysqld--initialize
7. Start the MySQL service and start the command as: net start MySQL
8. Setting Environment variables
Open the Windows environment variable settings, new system variable mysql_home, the variable value is the installation path of MySQL, here is D:\Program Files\mysql-5.7.10-win32;
Add to the path variable of the environment variable ;%mysql_home%\bin;
9. Log in to MySQL server
Mysql–u root–p
(initial state, MySQL administrator user name is root, password default is empty)
10. Change the password
1) Modify the MySQL configuration file My.ini, and add a line under [Mysqld] Skip-grant-tables
2) Restart MySQL, login to MySQL (mysql–u root-q), the prompt to enter the password, because the password is empty, so press ENTER to
3) Change the password as shown
use MySQL for connection database
Flush privileges; Refresh permissions, this step is important and must be performed
4) Restore the configuration file My.ini, delete skip-grant-tables this line, restart MySQL
5) Password modification completed at this time \ (^o^)/
# during the configuration process, the following issues are likely to occur:
That's because you manually created the data folder under the D:\Program files\mysql-data-5.7.10 folder, in which case you need to delete the Data folder and enter the command mysqld--initialize. You can find that the data folder is automatically generated and there are multiple files under the folder, at which point the input command net start MySQL is available.
#mysql常用命令
- Start MySQL service: net start MySQL
- Stop MySQL service: net stop MySQL
- Uninstall MySQL Service: SC delete MySQL
MySQL 5.7.10 Installation-free configuration