MySQL5.7.21 Installation and Configuration

Source: Internet
Author: User
Tags mysql client

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.