Download mysql5.7 extracting package Download MySQL Community Server, unzip the file. https://dev.mysql.com/downloads/mysql/
Step 1: Create a new my.ini file, write the following, where necessary to mysql installation directory and modify data storage directory to store their own MySQL installation directory and data directory
[mysql] # Mysql client to set the default character set default-character-set=utf8 [mysqld] Set # 3306 Port port = 3306 # Set the mysql installation directory basedir=D:\Deng24438\downloads\myDownloads\mysql-5.7.21-winx64 # Set the data storage directory of mysql database datadir=D:\Deng24438\downloads\myDownloads\mysql-5.7.21-winx64\data # Maximum number of connections allowed max_connections=200 # Server default character set used for the 8-bit coded character set latin1 character-set-server=utf8 The default storage engine that will be used when creating a new table # default-storage-engine=INNODB
Step 2: Run as Administrator cmd, enter the MySQL bin directory, enter the following command to install sql service.
Prompted Service successfully installed after executing the command. Represents a successful installation (if not open with administrator cmd, here will not pass).
mysqld -install
If you execute the command appears similar to the following questions, you need to own to the official website to download https://www.microsoft.com/zh-cn/download/confirmation.aspx?id=40784
The specific need to download the version which depends on the specific issue (Baidu Go) best to the official website to download.
Step 3: Execute the following command to initialize the sql service after executing the command will generate data files in the directory and create root user.
data file must not manually create an empty folder, data folder is content must be initialized by executing the following command.
If this step is not performed, to manually create a named data empty folder, the service failed to start.
mysqld --initialize-insecure --user=mysql
Step 4: Execute the following command, open the sql service, the success of the operation, then there will be "MySQL service has been launched successfully."
net start mysql
Step 5: Run the following commands into mysql, the password is randomly generated password, random passwords can be viewed through the .err file data. FIG: @localhost: after random password
mysql -u root -p password
Step 6: Execute the following command to change the password. mysql installation is complete. Environment variables can also be configured to facilitate the operation command, the specific configuration similar to jdk environment variable, which is not explained.
user mysql; ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'new password';