Mysql-5.7.20 practical download, installation and configuration methods, as well as simple operations, mysql-5.7.20 practical

Source: Internet
Author: User

Mysql-5.7.20 practical download, installation and configuration methods, as well as simple operations, mysql-5.7.20 practical


1.Download:

Mysql-5.7.20 is unzipped version free installation, mysql-5.7.20: http://dev.mysql.com/downloads/mysql/



Download directly without registration or logon.

2.Installation:

Place the downloaded mysql compressed package's unzipped directory in your favorite location.


3. Configuration:

Use notepad ++ to create an ini file named my. ini and place it in the mysql installation directory. The file content is:

[Mysql] # set the default character set of the mysql client default-character-set = utf8 [mysqld] # set port 3306 to port 3306 # set the mysql installation directory basedir = D: \ mysql \ mysql-5.6.17-winx64 # Set the mysql database data storage directory datadir = D: \ mysql \ mysql-5.6.17-winx64 \ data # maximum number of connections allowed max_connections = 200 # the character set used by the server defaults to the 8-bit latin1 character set character-set-server = utf8 # default storage engine default-storage-engine = INNODB

 

(When starting the service later, some friends will see: "mysql service cannot start the service and no error is reported." In fact, mysql has no data directory after mysql 5.6, many users will create a data directory according to the previous version of the installation, so that mysql cannot be started .)

4. Install and start the mysql service:

4.1 install the mysql service:

Open the cmd window as an administrator and switch the directory to the bin directory of your mysql installation directory.

Then, enter mysqldinstall In the cmd window and press enter to run the command.

Note: Run cmd as an administrator.

Enter mysqld -- initialize-insecure -- user = mysql

(After executing the preceding command, MySQL creates a data folder and creates a default database. The logon username is root and the password is blank.) (the origin of the data folder) (If you do not run this command, an error is returned when you directly start the service)

4.2 start the mysql service:

Enter net start mysql to start the service. OK is successful. Of course, you can also find mysql to start the mysql service in "Computer Management-service and application-service.

After starting the service, if you do not want to switch the directory in cmd and want to directly enter the mysql statement, you need to add the path of the bin directory of the mysql installation directory to the path variable of the system environment variable.

Note that when installing the mysql service, you must switch to the bin directory of the mysql installation directory, whether or not you have configured the environment variables, otherwise, after the installation is complete, an error will still be reported-"system error occurs 2 the system cannot find the specified file. ".

4.3 close the mysql Service

When you need to disable the mysql service, switch to the bin directory of the mysql installation directory. Enter net stop mysql.

5. Basic mysql operations:

After the service is started, if you add the path of the bin directory of the mysql installation directory to the path variable of the system environment variable, then, you do not need to switch to the bin directory for mysql operations in cmd.

5.1 log on to/enter the mysql database

Enter mysql-u root-p in the cmd window, press enter, and enter password again.

Because no user name or password is set during installation, the default logon user name is root and the password is blank.

5.2 initialize Password

When the root user logs on to mysql, enter set password for root = PASSWORD ('Password ');

5.3 view databases and data tables

Mysql> show databases;

Mysql> use sys;

Mysql> show tables;

5.3 exit mysql> enter

5.4 Note: When a command is entered, line feed does not allow mysql to terminate the input and execute the command. To execute the command, add a semicolon (;) after the command (;)

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.