MySQL v5.7.18 decompression installation tutorial, mysqlv5.7.18

Source: Internet
Author: User

MySQL v5.7.18 decompression installation tutorial, mysqlv5.7.18

Download MySQL

Https://dev.mysql.com/downloads/mysql/5.1.html#downloads

The PC is 64-bit, so download: Windows (x86, 64-bit), ZIP Archive

Decompress and install

1. decompress the downloaded package to the specified directory and decompress it to the Directory D: \ Program Files (x86.
Therefore, the full path of the MySQL (installation) package is: D: \ Program Files (x86) \ mysql-5.7.18-winx64

2. After decompression, configure the system environment variables.

New system environment variables:

Key: MYSQL_HOME

Value: D: \ Program Files (x86) \ mysql-5.7.18-winx64

Add % MYSQL_HOME % \ bin in Path

3. decompress the package and prepare the my. ini file.

Note: (it is said) after decompression of the previous version, there will be a my-default.ini or my. ini file under the extraction directory, however, v5.7.18 after decompression, there is no such file. Therefore, you must manually create the my. ini file. The specific (complete) content of the file is as follows:

[client]port=3306default-character-set=utf8[mysqld]port=3306character_set_server=utf8basedir=%MYSQL_HOME%datadir=%MYSQL_HOME%\datasql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'[WinMySQLAdmin]%MYSQL_HOME%\bin\mysqld.exe

After editing the my. ini file, put my. ini in the bin directory.

4. Open the cmd command window as an administrator and switch the directory to the bin directory under the MySQL installation package.

5. Install the MySQL database and run the following command:

mysqld.exe -install

After the command is executed, the system prompts: Service successfully installed. indicates that the installation is successful.

6. initialize mysql Data and create a root user with an empty password. Run the following command:

mysqld --initialize-insecure --user=mysql

Note: The final parameter -- user = mysql does not need to be added in windows, but it seems very important in unix and other systems.

After the command is executed, the system will automatically generate the corresponding data directory and automatically create a root user with a blank password. The initialization is successful.

7. Start the mysql service and run the following command:

net start mysql

After the command is executed, the following message is displayed:

MySQL service is starting ..

The MySQL service has been started successfully.

Note: to log on to mysql, the service must be started first. The same will happen in the future.

8. After the service is started, because the newly created root user has a blank password, you must first set the password. Run the following command:

Mysqladmin-u root-p password Enter the new password Enter password: Enter the old password here

After the preceding two commands are executed, the new password of the root user is successfully set if Enter password: And the old password entered is correct. To log on to the root user, you must use the new password.

Note: The newly created root user has a blank password. Therefore, when you change the password of the root user for the first time, you can press Enter password: without entering any password.

9. At this point, MySQL v5.7.18 has been fully decompressed and installed. Therefore, you need to stop the MySQL service that has been started earlier and run the following command:

net stop mysql

Note:

After the above processing, if you only use the command line window to perform related operations on mysql,
For example, create database xxx;
For example, create table xxx;
For example, SELECT * from xxx where xxx;
For example, insert into xxx (...) VALUES (...);
For example :........

As long as the corresponding statement syntax is correct, there is no problem. However, if Navicat is used for related query operations (Note: I use v11.2.7, that is, the latest version), No matter what operations are performed, the operation is actually successful, but at the same time, an error message will also be prompted, as shown below:

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

After reading online materials, you can execute the following statements in Navicat:

SET sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';SELECT @@sql_mode;

Log on to and use MySQL

The installation of the MySQL database has been completed. After the installation is successful, you can log on to the root user and perform data operations, such: create, add, delete, modify, and query tables. The following is a simple process:

1. Open cmd as an administrator and switch it to the bin directory of the mysql installation directory.

2. net start mysql // note: this command is used to start the mysql service.
Mysql-u root-p // Description: This command is used to log on to the root user.
Enter password: the password of the previously set root User

3. After correct logon, you can perform operations on the data, such as adding, deleting, modifying, and querying data. Example:

Mysql> show databases; // display all databases
Mysql> select statement ............
...

4. if you no longer use the database, log out of the user and stop the service. Run the following command:

Mysql> quit;

5. net stop mysql

Delete Database

If you no longer want to use mysql, run the following command:

Mysqld -- remove

The above is my practice record. It is for your reference only. Thank you for your correction and communication!

=== [Author: jacc. kim] & [e-mail: 175246359@qq.com] ====

The above is a detailed tutorial on MySQL v5.7.18 decompression. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.