1、 MySQL installation

  1. Download community version on official website

  2. Unzip to Disk C: C:\mysql-5.7.21-winx64

  3. Run the command line as an administrator and enter the directory C:\mysql-5.7.21-winx64\bin

  1. Registration service:C:\mysql-5.7.21-winx64\bin>mysqld install mysql5.7.21

  2. Initialize database: C:\mysql-5.7.21-winx64\bin>mysqld --initialize

  3. Startup database:C:\mysql-5.7.21-winx64\bin>net start mysql5.7.21

  4. Sign database:C:\mysql-5.7.21-winx64\bin>mysql -u root -p

Note: the login password can be found in the *. err file of MySQL installation directory, for example, the red character: 2018-01-17T09:26:11.260249Z 1 [Note] A temporary password is generated for root@localhost: _=(H,?pX.7yZ

  1. update root user password:C:\mysql-5.7.21-winx64\bin>mysqladmin -u root -p _=(H,?pX.7yZ password 1234

2、 MySQL configuration

Create C:\mysql-5.7.21-winx64\my.ini by yourself. The contents of the file are as follows:

[mysqld]
#Set 3306 port
port = 3306
#Set the installation directory of MySQL
basedir=C:\mysql-5.7.21-winx64
#Set the storage directory of MySQL database data
datadir=C:\mysql-5.7.21-winx64\data 
#Maximum connections allowed
max_connections=200
#The character set used by the server defaults to the 8-bit Latin1 character set
character-set-server=utf8
#Default storage engine to use when creating new tables
default-storage-engine=INNODB
#Set to strict mode
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysql]
#Set MySQL client default character set
default-character-set=utf8
Like The Article To View All

All Comments

Leave a Reply Cancel Reply

Tips: Your email address will not be disclosed!

If you can't see clearly,please click to change...