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
CSS Viewport units have been around for the past ...
Several commonly used string methods in JavaScrip...
1. Download mysql-8.0.17-winx64 from the official...
When we edit a layout, we usually use horizontal ...
Table of contents What is maintainable code? Code...
1. To prohibit all IP addresses from accessing th...
What is a transaction? A transaction is a logical...
First of all, let's talk about the execution ...
View container logs First, use docker run -it --r...
1. Prerequisites Since I have installed it severa...
MySQL 8.0: MVCC for Large Objects in InnoDB In th...
1 Download MySQL8 from the official website and i...
Table of contents What is axios? Axios request ty...
SSH public key authentication is one of the SSH a...
serializable serialization (no problem) Transacti...