mysql 5.7. 20 win 64 Installation and Configuration Method

  • 2021-09-20 21:49:31
  • OfStack

mysql-5. 7.20-winx64. zip Installation Package Free of Installation Steps:

https://dev.mysql.com/downloads/file/?id=473309

Environment variable settings:

Put C in Path:\ Program Files\ mysql-5. 7.20-winx64\ bin

Right--Command Prompt (Administrator)--cd C:\ software\ mysql\ mysql-5. 7.20-winx64\ bin--The following steps:

1.mysqld install

2. Initialize the mysql data directory (mysql-5. 7 does not have this directory after decompression) and generate the password: mysqld-initialize-insecure success is unresponsive

3. Execute net start mysql in the dos interface (any directory)

4. Execute mysql-uroot in dos interface (any directory), that is, log in with root user

5. update user set authentication_string=password ('123456') where user= 'root' and Host = 'localhost'; Set the password to 123456

#### update MySQL.user set authentication_string=password('root') where user='root';

6. mysql-u root-p; (Login to mysql with password)

7. net stop mysql (stop mysql)--mysqld remove (remove mysql), try the installation again

Header (header): The name of every 1 column; Column (row): A collection of data with the same data type; Line (col): Every 1 line is used to describe the specific information of a person/thing; Values (value): Row details, each value must be of the same data type as the column; Key (key): The method used in a table to identify a particular person\ object. The value of the key is uniqueness in the current column.

Login to MySQL

When the MySQL service is already running, we can log in to the MySQL database through the client tools that come with MySQL. First, open the command prompt and enter the name in the following format:

mysql-h Hostname-u Username-p

-h: This command is used to specify the MySQL host name that the client wants to log in, and this parameter can be omitted when logging in to the current machine; -u: The user name to log in to; -p: Tells the server that a password will be used to log in. If the username and password to log in is blank, this option can be ignored.

For example, log in to the MySQL database that was just installed locally, type mysql-u root-p at the command line and press Enter to confirm. If the installation is correct and MySQL is running, you will get the following response:

Enter password:

If the password exists, enter the password to log in; If it does not exist, press Enter to log in directly. According to the installation method in this article, the default root account is password-free. After logging in successfully, you will see the prompt of Welecome to the MySQL monitor...

Then the command prompt will be 1 straight with mysql > Add a flashing cursor and wait for the command to be entered. Enter exit or quit to log out.

Create 1 database

Use the create database statement to complete the creation of the database in the following format:

create database 数据库名 [其他选项];

For example, we need to create a database named samp_db and execute the following command from the command line:

create database samp_db character set gbk;

To facilitate the display of Chinese at the command prompt, the database character encoding is specified as gbk through character set gbk at creation time. Successful creation results in a response of Query OK, 1 row affected (0.02 sec).

Note: The MySQL statement is marked with a semicolon (; ) as the end of the statement, if a semicolon is not added at the end of the statement, the command prompt will start with- > Prompt you to continue typing (there are some special cases, but the plus semicolon is 1, which can't be wrong);

Tip: You can use show databases; Command to see which databases have been created.

Using mysqladmin mode:

Open the command prompt interface and execute the command: mysqladmin -u root -p password 新密码

Prompt to enter the old password to complete the password modification after execution. When the old password is empty, press Enter directly to confirm.

MySQL Workbench Official Introduction: http://www.mysql.com/products/workbench/

MySQL Workbench Download page: http://dev.mysql.com/downloads/tools/workbench/

Summarize


Related articles: