September 27, 2017 install and configure MySQL
1. Download mysql (i download version mysql-5.7.19-winx64)
Installation path is D:\mysql-5.7.19-winx64
2. Generate the MySQL configuration file My.ini
Placement Path is D:\mysql-5.7.19-winx64
3.my.ini configuration information
/******/
[MySQL]
# Set the MySQL client default character set
Default-character-set=utf8
[Mysqld]
# Skip_grant_tables This statement can enter MySQL without a password
#设置3306端口
Port = 3306
# set up the MySQL installation directory
Basedir=d:\mysql-5.7.19-winx64
# set up the data storage directory for MySQL database, see 6
Datadir=d:\mysql\data
# Maximum number of connections allowed
max_connections=200
# The character set used by the service side defaults to the 8-bit encoded latin1 character set
Character-set-server=utf8
# The default storage engine that will be used when creating a new table
Default-storage-engine=innodb
/****/
4. Configure Environment variables
Add D:\mysql-5.7.19-winx64\bin in Path
5. Related command cmd
. net stop MySQL shutdown MySQL service
5.2 net start MySQL open MySQL service
5.3 mysqld install add MySQL service
5.4 mysql-u root-p root login mysql (enter password after login)
5.5 mysqld--initialize Initialize MySQL database, log configuration
5.6 Use MySQL to open MySQL database
6. Configure MySQL database, log and other storage locations
Enter Mysqld--initialize (see 5.5)
7. Problems occurred
7.1 MySQL Access denied for user [email protected] error resolution
Error code 1045 username and password do not match, modify root corresponding password field can be
The corresponding important fields in the MySQL database are as follows
The authentication_string corresponds to the password.
*81f5e21e35407d884a6cd4a731aebfb6af209e1b corresponding Password root
Change password, command as follows
UPDATE USER SET authentication_string=password (' root ') WHERE user= ' root ' and HOST = ' localhost ';
MySQL first installation and problem solving