http://www.cppcns.com/shujuku/mysql/283231.html You can also refer to this 8.0.18 installation method 1. Download the zip installation package (extract it to the specified folder) 1) Download the installation package from the MySQL official website 2) Click to enter, and click in the order indicated in the figure to enter the download page 3) Download the compressed package marked in the red box (note that this is the 64-bit version. If you want to download the 32-bit version, click go to Download Page to switch) 4) Unzip to the specified folder (move this folder to where you want to install MySQL, that is, the directory you move to is the directory where MySQL is installed, for example, I put it under G:\anzhuangbao\MYSQL) 2. Configure the environment Open My Computer->Properties->Advanced->Environment Variables, select PATH in System Variables, and add the path of your mysql bin folder after it (such as: G:\anzhuangbao\MYSQL\mysql-8.0.15-winx64\bin), note that it is appending, not overwriting, and then confirm 3. Configuration files (some modifications are required before installation) The unzipped folder does not have my.ini and data files, as shown below Create a text document and rename it to my.ini (open it in Notepad) [mysqld] # Set port 3306 port=3306 # Set the installation directory of mysql. It is best to use '/' to represent the path basedir=C:\mysql\mysql-8.0.18-winx64 # Set the storage directory of mysql database data. It is best to use '/' to represent the path datadir=C:\mysql\mysql-8.0.18-winx64/data # Maximum number of connections allowed max_connections=200 # The number of connection failures allowed. This is to prevent someone from trying to attack the database system from this host max_connect_errors = 10 # The default character set used by the server is UTF8 character-set-server=utf8mb4 # The default storage engine that will be used when creating a new table default-storage-engine=INNODB # By default, the "mysql_native_password" plug-in is used for authentication. default_authentication_plugin=mysql_native_password # Change mode sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' [mysql] # Set the default character set of the mysql client to default-character-set=utf8mb4 [client] # Set the default port used by the mysql client to connect to the server port = 3306 default-character-set=utf8mb4 Note: basedir = the path where your unzipped file is located 4. Open cmd as an administrator (I don’t know how to use Baidu, there are a lot of them), and enter the command Then initialize Notice! [Note][MY-010454][Server] Generating temporary password for root@localhost: 9P0gYk-? 0,kT where root@localhost:9P0gYk-? 0, kT is the initial password (excluding the first space). Before changing the password, you need to remember this password as it will be needed for subsequent logins. Copy the password and save it first!!! 5. Then enter mysqld --initialize-insecure --user=mysql and press Enter 6. Then enter mysqld install and press Enter I have already pressed it, so it will show that it already exists. 7. Enter net start mysql and press Enter to start the MySQL service 8. Then enter mysql -u root -p and press Enter to log in to the MySQL database After pressing Enter, you will be prompted to enter the password. Just press Enter. The following figure shows that the login has been successful 9. Then enter show databases; and press Enter. Pay attention to the semicolon, which must not be missing! ! ! You can see that the database has been displayed! 10. At this point, the compressed version of MySQL has been installed successfully~perfect If you forget your password, it doesn’t matter. Don’t panic. 1. Run cmd as an administrator and enter the bin directory where MySQL is installed (C:\mysql\mysql-8.0.18-winx64\bin) 2. Execute the command, net stop mysql (stop mysql service) 3. Execute the command, 4. Reopen a cmd, and enter the bin directory of mysql (C:\mysql\mysql-8.0.18-winx64\bin) with the same administrator account 5. Execute the command, mysql -u root -p, without entering a password, and log in directly. You will successfully log in to mysql 6. Execute the command flush privileges; (Refresh the permission table. This step must be performed. I did not perform this step and repeated the modification many times without success.) 7. Execute the command 8. Execute the command flush privileges; (required) 9. Exit mysql, control + Z. (If exit does not work). 10. Re-run cmd with the administrator command, enter the bin directory of mysql, and execute the command net start mysql (start the mysql service) 11. Execute the command mysql -u root -p, enter the new password, and log in to mysql successfully. I solved it, hope it helps you. You may also be interested in:
|
<<: Detailed tutorial on installing php-fpm service/extension/configuration in docker
>>: JS realizes the automatic playback effect of pictures
Introduction Animation allows you to easily imple...
In the table header, you can define the light bor...
This article mainly introduces the implementation...
In the fifth issue of Web Skills, a technical sol...
The difference between run and start in docker Do...
MySQL bidirectional backup is also called master-...
Data display has always been a demand that all wa...
When using MySQL, dates are generally stored in f...
Table of contents 1. Demand 2. Solution 3. The fi...
Table of contents Problem scenario: Solution: 1. ...
In ordinary projects, I often encounter this prob...
By default, /etc/default/docker configuration wil...
<br />Every family has its own problems, and...
The table caption can be placed above or below th...
The props of the component (props is an object) F...