Mysql 5.7.17 installation and configuration method graphic tutorial (windows10), 5.7.17windows10

Source: Internet
Author: User

Mysql 5.7.17 installation and configuration method graphic tutorial (windows10), 5.7.17windows10

How to install and configure mysql 5.7.17

Step 1Download mysql-5.7.17-winx64.zip to mysql.

Step 2Extract mysql-5.7.17-winx64.zip

Step 3 Create a new my. ini fileAnd enter the basic mysql configuration in Notepad:

[Mysql]; set the default character set of the mysql client default-character-set = utf8 [mysqld]; set port 3306 = 3306; set the mysql installation directory basedir = E: \ mysql5.7; set datadir = E: \ mysql5.7 \ data as the data storage directory of the mysql database; max_connections = 200; the default character set used by the server is the 8-bit latin1 character set character-set-server = utf8. When creating a new table, the default storage engine default-storage-engine = INNODB


Step 4Open the cmd window as an administrator and switch the directory to the bin directory of the decompressed file. EnterMysqld installPress enter to run it. Note that mysqld is not mysql.

Step 5Next we will useMysqld -- initializeInitialize the data DIRECTORY first. Otherwise, the data folder does not appear in the folder of mysql5.7.

Step 6Then, enterNet start mysqlStart the service. Net stop mysql Service

Step 7

(1). Since MySQL5.7 will generate a random password in the root directory at the first startup after installation, the file name is. mysql_secret
Therefore, You need to log on with a random password, and then use the following command to change the password
"Set password = PASSWORD ('new password ');"

(2) When you forget the root password,

Take windows as an example:

1. Disable the running MySQL service.

2. Open the DOS window and go to the mysql \ bin directory.

3. InputMysqld -- skip-grant-tablesEnter
-- Skip-grant-tables indicates that the permission table authentication is skipped when the MySQL service is started.

4. Open another DOS window (because the DOS window can no longer be moved) and go to the mysql \ bin directory.

5. EnterMysqlPress enter. If yes, the MySQL prompt> will appear.

6. Connect to the permission Database: use mysql; (do not forget the last plus points ).

7. Change the password: update user set password = password ("123") where user = "root"; (do not forget the last plus points ).

If the password is changed
** Mysql password change ERROR 1054 (42S22 )**

Use mysql> update mysql. user set authentication_string = password ('000000') where user = 'root' and Host = 'localhost ';
Or update MySQL. user set password = PASSWORD ('000000') where User = 'root ';

8. mysql> fluSh privileges; # Update Permissions

9. Exit quit.

10. log out of the system and enter,
Enter mysql-u root-p
Log On with the username root and the new password 123456.

(3) When you know the root password

Method 1:UseSET PASSWORDCommand
First, log on to MySQL.
Format: mysql> set password for username @ localhost = password ('new password ');
Example: mysql> set password for root @ localhost = password ('20140901 ');

Method 2:UseMysqladmin
Format: mysqladmin-u username-p old password New password
Example: mysqladmin-uroot-p123456 password 123

Method 3:Use UPDATE to directly edit the user table
First, log on to MySQL.

mysql> use mysql;  mysql> update user set password=password('123') where user='root' and host='localhost'; mysql> flush privileges;

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.