Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql 5.7.27 how to install and configure

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to install and configure mysql 5.7.27. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Download steps visit the official website: https://www.mysql.com/

Select Community under Downloads

Click the MySQL Community Server above to download the corresponding version to enter the download interface:

Find the link to MySQL Community Server 5.7and click to enter:

According to the version of your computer, choose to download the corresponding ZIP file, my computer is 64-bit, so select this item to download, click Download to enter the following interface:

Just click No thanks,just start my download and start downloading

After downloading, extract the file to the disk and directory you want to save. I unzipped the file to the E:\ Program Files\ Mysql directory.

The above completes all the work of the download.

two。 Configure environment variables system-> advanced system settings-> environment variables-> system variables

Click New, change the name to: MYSQL_HOME, and add the location of your mysql-5.7.27-winx64 folder.

Mine is in E:\ Program Files\ Mysql\ mysql-5.7.27-winx64, as shown in the figure:

Edit Path, copy;% MYSQL_HOME%\ bin to the end of the original value, as shown below:

3.

Configure the my.ini file

Create a new my.ini file in your mysql-5.7.27-winx64 directory, and mine create a new file in the E:\ Program Files\ Mysql\ mysql-5.7.27-winx64 directory. The content of the my.ini file is:

[mysqld] # Port number port = path of 3306#mysql-5.7.27-winx64 basedir=E:\ Program Files\ Mysql\ mysql-5.7.27-winx64#mysql-5.7.27-winx64 path +\ datadatadir=E:\ Program Files\ Mysql\ mysql-5.7.27-winx64\ data # maximum number of connections max_connections=200# Encoding character-set-server=utf8default-storage-engine=INNODBsql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_ tables [MySQL] # Encoding default-character-set=utf8

After the creation, proceed to the next step.

4. Install MySQL

1. Enter cmd in the input box to run as an administrator, and be sure to run as an administrator here, otherwise there will be Install/Remove of the Service Denied! (the installation / uninstall service is denied) due to insufficient administrative privileges during the installation process, which is very important!

In cmd, go to the E:\ Program Files\ Mysql\ mysql-5.7.27-winx64\ bin directory:

Enter the installation command: mysqld-install. If Service successfully installed appears, the installation is successful. If Install of the Service Denied appears, cmd is not run with administrator privileges:

Then continue typing the command: mysqld-- initialize, without any prompts at this time:

Enter the startup command: net start mysql, and the following prompt appears to prove that MySQL started successfully:

5. Set MySQL password

1. The main purpose of setting the password here is to solve the problem of: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

two。 First stop the MySQL service and enter the command line net stop mysql:

3. Find my.ini in the E:\ Program Files\ Mysql\ mysql-5.7.27-winx64 directory, add skip-grant-tables on any line under the [mysqld] field, and save it:

4. Restart MySQL, enter the startup command: net start mysql, and the following prompt appears to prove that MySQL started successfully:

Enter the command mysql-u root-p without entering a password and enter directly:

Successful entry into MySQL! Haha, when you come to this step, you should be happy!

5. Enter the command line use mysql to enter the database:

6. Enter the command line update user set authentication_string=password ("xxxxxx") where user= "root"; xxxxxx is the new password you set. If the following message appears after tapping enter, it proves that the modification is successful!

7. Stop the MySQL service manually, enter the service in the win10 search bar, and find the MySQL. Right click, and then click stop.

Then delete the line skip-grant-tables in the my.ini file just now and save it off.

8. Start cmd (administrator identity) again, enter the startup command: net start mysql, then enter mysql-u root-p, and then enter the password you just set, the following information appears to prove that the setting is successful!

Then enter the command line use mysql to verify it, and an error is reported:

Since you haven't reset the password, just reset it.

Type the command line alter user user () identified by "xxxxxx"; my password is 123456, so I type alter user user () identified by "123456"; enter! It's getting closer and closer to victory!

Re-enter the command line use mysql to verify, successful!

Thank you for reading! This is the end of the article on "how to install and configure mysql 5.7.27". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report