It took me three hours to install MySQL myself. Even though there are so many tutorials, I still wasted too much time on things that shouldn't have been spent. I hope this article can help you avoid detours~~ 1. Download https://www.mysql.com/ Official website address I downloaded the 64-bit version. 2. Unzip After downloading, I chose to decompress it directly to drive D. The file address is: D:\mysql-5.7.23-winx64. I made it clear here for the subsequent environment configuration. You can also choose the corresponding location according to your personal preferences. 3. Environment Configuration The environment configuration is for later installation using cmd administrator commands. First, use the control panel, open the system, find advanced system settings -> environment variables There are two ways to configure the environment: Method 1: Create a new variable in the system variable named MYSQL_HOME (you can also use your own preference, but it must be letters), and write the variable value to the corresponding mysql location. I wrote D:\mysql-5.7.23-winx64 here
Method 2: Create a new one directly in the system variable path editor, D:\mysql-5.7.23-winx64\bin, which is the bin directory file address in the mysql file. 4. Create a new my.ini file. There is no such file in version 5.7, so you need to create it yourself. The content is as follows: Please note that you need to modify your own file address and version information. [mysqld]port = 3306basedir = D:/mysql-5.7.23-winx64datadir = D:/mysql-5.7.23-winx64/datamax_connections = 200character-set-server = utf8default-storage-engine = INNODBsql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES[mysql]default-character-set = utf8 After completing these configurations, you can start the installation. I spent a long time fiddling with the following process. It hurts to think about it. I would feel sorry for my detour if I didn’t write it down. I also hope it can help everyone save time. 5. Installation First, run cmd as an administrator and enter the bin directory file address: D:\mysql-5.7.23-winx64\bin. You will find that it always prompts: It has obviously been configured. You will find various tutorials online saying that when setting environment variables, add a ";" or a period in front of the file address and a semicolon after it. In fact, the Windows 10 system does not require these, and this prompt will appear no matter how you add it. The final solution is: C:\WINDOWS\system32>cd /d D:\mysql-5.7.23-winx64\bin It's so unexpected and shocking that I almost want to vomit blood. Just add in front of the file address cd /d will do the trick. D:\mysql-5.7.23-winx64\bin>mysqld -installService successfully installed. After the installation is successful, start the configuration. Execute the following code and you will find that there is a data folder in the mysql folder. D:\mysql-5.7.23-winx64\bin>mysqld --initialize-insecure --user=mysql Then D:\mysql-5.7.23-winx64\bin>net start mysqlMySQL service is starting.MySQL service has been started successfully. Okay, now you can start using it. Let’s happily start the journey of training your SQL skills~~O(∩_∩)O D:\mysql-5.7.23-winx64\bin>net start mysql enter mysql -u root -p, the system will prompt you to enter Enter passwords:, this time you need Reset your password. Steps: 1. Edit the MySql configuration file: my.ini (in the MySql installation directory). Open the configuration file, add skip-grant-tables after the first line of the last line of the file, then save and exit. 2. Restart the MySql service: first close net stop mysql, then start net start mysql 3. Set a new root password. mysql -u root -p Press Enter directly to enter the database without entering a password. At this time, execute use mysql in the command line (switch to the system database) Execute the following statement to modify the root user password: update user set authentication_string=PASSWORD(“123456”) where user='root'; The password set at this time is: 123456 4. Note: Restore the configuration file, that is, delete the line of code just added in my.ini. Close the cmd interface window and reopen it. Start the mysql service, net start mysql Enter your account name and password 123456 C:\WINDOWS\system32>mysql -u root -pEnter password: ****** The results show: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 3Server version: 5.7.23 MySQL Community Server (GPL)Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. You can start the database operation~~ Summarize The above is the installation tutorial and configuration method of MySQL 5.7.23 version introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: JavaScript to implement dynamic digital clock
Table of contents question 1. Install webpack web...
Table of contents Install mockjs in your project ...
Table of contents 1. Developer Platform Configura...
Table of contents 1. Preliminary preparation 1.1 ...
The div element is used to provide structure and b...
Preface When the code runs and an error occurs, w...
In the vertical direction, you can set the row al...
Currently encountering such a problem My situatio...
A WeakMap object is a collection of key/value pai...
This article shares the specific code for the WeC...
The specific upgrade script is as follows: Dynami...
Now we can use an attribute of input called autoco...
Preface 1. Benchmarking is a type of performance ...
I have read countless my.cnf configurations on th...
1. Download the MySQL 5.7.11 zip installation pac...