mysql 5.7. 13 winx64 Installation Configuration Tutorial of win10

  • 2021-07-01 08:25:09
  • OfStack

This article example for everyone to share mysql 5.7. 13 winx 64 installation configuration method graphic tutorial, for your reference, the specific content is as follows

Download

Address: http://dev.mysql.com/downloads/file/? id=463242

Installation

1. Unzip the downloaded mysql-5. 7.13-winx64. zip to the directory you need to transfer (eg: D:\ mysql);

2. Configure the name my. ini in my_default. ini under the extraction directory

The relevant configuration is as follows:


# These are commonly set, remove the # and set as required.
basedir = D:\mysql5.7 ( mysql Installation Directory) 
datadir = D:\mysql5.7\data ( mysq The storage directory of the data in, set by yourself) 
port = 3306 ( mysq Port number of) 
# server_id = .....

3. Add environment variables

Add D:\ mysql5.7\ bin to the environment variable;

eg:......; D:\ mysql5.7\ bin

4. Initialize

Enter the bin folder of MySQL
mysqld install
mysqld initialize console (there is an root @ localhost: there is a series of alphanumeric symbols behind it, which is a random password automatically generated by MySQL for you. 1 must be written down, and 1 will be used when we log in to MySQL database).
PS: Use-initialize to generate random password, and use-initialize-insecure to generate empty password. After initialization, data folder will be automatically generated, so you don't need to build it yourself.

5. Start mysql

net start mysql

6. Enter msyql and set the password


D:\mysql5.7\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.13 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> set password=password(' Your own password ');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql>

Connect to remote mysql (connection between two win7 LANs mysql)

Error in connection:

1. Error description: When setting the remote permission of root: ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY' (it is better not to use this, but to use the following method for authorization).
Solution: It has been set up successfully.

2. Authorization in mysql:


mysql> GRANT ALL PRIVILEGES ON . TO  ' root'@'%' IDENTIFIED BY  'Password ' WITH GRANT OPTION; 
mysql> flush privileges; 

3. Close the firewall (pay attention to the correctness of ip address of win7 as the carrier of mysql)


Related articles: