one, MySQL installation
1, the official website Download Community Edition
2. Unzip to C Drive: C:\mysql-5.7.21-winx64
3. Run command line as Administrator , enter directory C:\mysql-5.7.21-winx64\bin
4. Registration Service:c:\mysql-5.7.21-winx64\bin>mysqld install mysql5.7.21
5. Initialize database:c:\mysql-5.7.21-winx64\bin>mysqld--initialize
6. Start the database:c:\mysql-5.7.21-winx64\bin>net start mysql5.7.21
7. Login Database:c:\mysql-5.7.21-winx64\bin>mysql-u root-p
Note that the login password is found in the MySQL installation directory *.err file, such as the red character: 2018-01-17t09:26:11.260249z 1 [Note] A temporary password is generated for [email Protected]: _= (H,?px.7yz
8, modify the root user password:c:\mysql-5.7.21-winx64\bin>mysqladmin-uroot-p_= (h,?px.7yz password 1234
Second, MySQL configuration
1, the creation of C:\mysql-5.7.21-winx64\my.ini, the file content is as follows:
[mysqld]
#设置3306端口
port = 3306
# set the installation directory for MySQL
basedir=c:\mysql-5.7.21-winx64
# set the data storage directory for the MySQL database
datadir=c:\mysql-5.7.21-winx64\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
# set to strict mode
sql_mode=no_engine_ Substitution,strict_trans_tables
[MySQL]
# Set the MySQL client default character set
Default-character-set=utf8
MySQL5.7.21 Installation and Configuration