MySQL Download and installation (Windows)

Source: Internet
Author: User
Tags mysql client mysql download save file mysql login

1: Download MySQL

Official website: https://dev.mysql.com/downloads/mysql/

Select the corresponding download file. (My computer is 64 bits, so this download is a 64-bit download file)

2: Install MySQL

Open the download file to extract to the specified file directory. (I unzip this directory for D:\mysql-5.7.21-winx64)

Open the extracted MySQL file under the root directory to create the My.ini (MySQL config file)

the contents of the My.ini file are as follows:
(It is recommended to copy and paste the following files directly)

You need to change the basedir and datadir paths to MySQL's decompression path.

[mysql]# set MySQL client default character set default-character-set =3306# Set the installation directory for MySQL basedir=d:\mysql-5.7 . -winx64# Set the data storage directory for the MySQL database datadir=d:\mysql-5.7. -winx64\data# Maximum number of connections allowed max_connections=# 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  -storage-engine=innodb
View Code

Locate the cmd command prompt and right-click Run as Administrator

Go to MySQL subdirectory bin

Input: mysqld--install (Install) mysqld--initialize (Initialize) net start MySQL (run)

3: Set MySQL login password

Previous versions of MySQL root account default password is not empty, if you log in with a blank password must be an error.

Password Setup steps:

    1. Save file at the end of the My.ini file by adding "skip-grant-tables" (Cancel permission settings)
    2. Restart MySQL Service
    3. CMD Enter Mysql-bin directory, enter mysql-u root-p , return, this time do not need a password to login
    4. Resets the password. Input use MySQL return
    5. Enter Update user set Authentication_string=password ("NewPassword") where user= "root"; (new version of MySQL database password field changed to authentication_string)
    6. Delete my.ini file End " skip-grant-tables" Save file
    7. Restart the MySQL service to log in to the root account with a new password

——————————————— installation is complete ———————————————

——————————— August 4, 2018 09:33:51 update ——————————

Another way to set the MySQL password.

After the MySQL installation, open the Data folder in the MySQL installation directory, there is a . err file , open with Notepad, you can see that there are lines inside

A temporary password is generated for [email protected]: xxxxxxxx

localhost: The following is the default password, copy this password to log in,

You must reset your password after you have successfully logged in, or you will always be prompted for the following line error.

You must reset your password using the ALTER USER statement before executing this statement.

Perform the following command to reset the password so that it can be used normally. You can refer to the following.

SET PASSWORD = PASSWORD (' NEW PASSWORD ')

MySQL Download and installation (Windows)

Related Article

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.