When first installed mysql environment, there will always encounter a variety of pit, after attempting to install the version of the database version and decompression, decompression feeling mysql version is more simple and convenient, save a lot of time to do professional things
I choose here is the 5.7.26 version, unzip version Download:
https://dev.mysql.com/downloads/mysql/5.7.html
Because I am a win10 64-bit system, so the choice is Windows (x86, 64-bit) , ZIP Archive
1. Unzip: Will be downloaded to decompress compressed packages to your favorite position, for example, I unzipped location is D: \ mysql-5.7.26-winx64
2, add the environment variable
added to the system variables in MYSQL_HOME environment variable, the variable value MySQL's root directory, for example mine is D: \ mysql-5.7.26-winx64
find a path, choose to edit, add at the end of the original value;% MYSQL_HOME % \ bin
3, add a new text configuration file my.ini file, modify the suffix .ini, modify the file name for my. The specific contents of the file is
[mysqld]
basedir=D:\mysql-5.7.26-winx64
datadir=D:\mysql-5.7.26-winx64\data
port = 3306
character_set_server=utf8
And the values of specific variables basedir datadir to make the appropriate changes in the database according to their own path
4, initialize the database:
as an administrator from identity open CMD execute the following command (note !!!! !!!! must be opened as an administrator, otherwise an error)
mysqld --initialize --user=mysql --console
The initial password will be randomly generated at the console end of the message, write it down (because of the special characters, it is easy to remember, it is best to save the entire message in Notepad)
5, MySQL will be added to the system serving
as an administrator from identity open CMD execute the following command (!!!! note must be turned on as an administrator, otherwise an error !!!!)
mysqld --install mysql
net start mysql
The installation is successful, it will show "service has started successfully."
6, start MySQL and change your password
to execute commands CMD console mysql -u root -p
After ENTER to proceed, enter just recorded random password
input command
set password for root@localhost = password('root');
At this point the root user password changes for the root
7. Download mysql management tool, sqlyog or navicat for mysql many online Baidu next on it