I summarized the previous notes on installing MySQL and shared them with you. Step 1: Download the unzipped version of mysql-5.7.17-winx64: http://dev.mysql.com/downloads/mysql/ Step 2: Unzip to the installation directory, such as: C:\myprogram\mysql-5.7.17-winx64 Step 3: Set environment variables The operation is as follows: 1) Right-click My Computer -> Properties -> Advanced System Settings (Advanced) -> Environment Variables 2) Select Path in the system variables Step 4: Modify the my.ini file in the C:\myprogram\mysql-5.7.17-winx64 folder. If it does not exist, you can copy my-default.ini to modify it: ######################################################### [client] port=3306 default-character-set=utf8 [mysqld] port=3306 character_set_server=utf8 basedir=%MYSQL_HOME% #Unzip directory datadir=%MYSQL_HOME%\data #Unzip the data directory in the directory sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [WinMySQLAdmin] %MYSQL_HOME%\bin\mysqld.exe ######## Step 5: Register MySQL as a Windows system service 1) Run cmd as an administrator and enter the bin directory under the MySQL decompression directory from the console: 2) Enter the service installation command: mysqld install MySQL --defaults-file="%MYSQL_HOME%\my.ini" Step 6: Start the MySQL service Method 1: Start the service command: net start mysql Open the management tool service and find the MySQL service. Start the service by right-clicking and selecting Start or directly clicking Start on the left Step 7: Change the password of the root account When the installation is just completed, the default password of the root account is empty. At this time, you can change the password to the specified password. For example: 123456 c:>mysql –u root mysql>show databases; mysql>use mysql; mysql>UPDATE user SET password=PASSWORD("123456") WHERE user='root'; mysql> FLUSH PRIVILEGES; mysql>exit But this does not allow successful login. Step 8: Modify the my.ini file and add the following command under [mysqld]: skip-grant-tables, then restart the mysql service Step 9: Log in and change the root user password c:>mysql –u root mysql>show databases; mysql>use mysql; mysql> UPDATE user SET authentication_string = PASSWORD('123456') WHERE user = 'root'; mysql> FLUSH PRIVILEGES; At this point, edit the my.ini file and delete the skip-grant-tables line, then restart MySQL. Otherwise, MySQL can still log in without a password. After success, you can log out and log in again to test whether it is successful. Note: When using Navicat to connect to MySQL, if MySQL error number 1862 appears: your password has expired, or, in the Run window, enter the bin directory, >mysql -uroot -p123456 to log in, and then execute select * from mysql.users Solution: MySQL> SET PASSWORD = PASSWORD('123456'); Query OK, 0 rows affected (0.03 sec) Then select * from mysql.users and you will get the result. Navicat can also connect successfully. Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for MySQL 5.7 versions Installation tutorials for MySQL 5.6 versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Three Ways to Find the Longest Word in a String in JavaScript (Recommended)
>>: Answer the caching principle of keep-alive components from the perspective of source code
Table of contents 1. props/$emit Introduction Cod...
Scenario: The interaction methods between parent ...
1. In the control panel, uninstall all components...
Preface In WeChat applet, you can use globalData ...
Build the image There are two main ways to build ...
Table of contents 1. The role of array: 2. Defini...
Important note: Before studying this article, you...
I recently reviewed some CSS-related knowledge po...
Because the distribution package of MySQL Communi...
Table of contents 1. Introduction 2. Prepare the ...
If someone asked you whether running EXPLAIN on a...
Usage Environment In cmd mode, enter mysql --vers...
I have written an article about mobile adaptation...
Preface Since MySQL 5.1.6, a very unique feature ...
In order to save installation time, I used the of...