1. Cause: I need to import a sql file, but I can't import it. When I execute this sentence, there is a problem. After some searching, it turns out that my database version (original MySQL version 5.5) is too low, and the version that supports this statement should be at least 5.7. So I went to the MySQL official website to download the latest version (8.0.15). `create_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP 2. Process: So here comes the question: there are two solutions. 1. Uninstall the 5.5 version of MySQL and install the 8.0.15 version directly. 2. Continue to install the 8.0.15 version without uninstalling the 5.5 version. My choice is ******* (you should understand it by looking at the title)~ 2.1 Download MySQL 8.0.15 https://dev.mysql.com/downloads/mysql/ Click the link to open the following webpage directly, select the Windows operating system, and download the zip pointed by the arrow. 2.2 Unzip MySQL 8.0.15 Unzip the downloaded compressed package. The files in the folder are as follows (the data folder and my.ini file are not there when they are unzipped) 2.3 Create a new data folder and my.ini configuration file data folder (empty is ok), add some parameters in my.ini. [mysqld] # Set port 3307 (the original mysql5 already occupies port 3306) port=3307 # Set the installation directory of mysql (your own directory) basedir=D:\mysql8\mysql-8.0.15-winx64 # Set the storage directory of mysql database data datadir=D:\mysql8\mysql-8.0.15-winx64\data # Maximum number of connections allowed max_connections=200 # The number of connection failures allowed. max_connect_errors=10 # The default character set used by the server is UTF8 character-set-server=utf8 # The default storage engine that will be used when creating a new table default-storage-engine=INNODB #Default authentication is done with the "mysql_native_password" plugin #mysql_native_password default_authentication_plugin=mysql_native_password [mysql] # Set the default character set of the mysql client to default-character-set=utf8 [client] # Set the default port used by the mysql client to connect to the server port = 3307 default-character-set=utf8 2.4 Add environment variables Change to your own Mysql8 path, to bin 2.5 Shut down the original mysql5 service Right click on my computer - Manage - Services and Applications - Services - Stop MySQL service 2.6 Installation ①Open a black window (CMD) as an administrator, switch to the bin directory of the mysql8 installation directory and execute mysqld --initialize --console Notice! After the execution is completed, the output result contains a paragraph: The "XI5ovf,x5G,?" after root@localhost: is the initial password (excluding the first space). Before changing the password, you need to remember this password as it will be needed for the first login. You can copy it to a text file and save it first. ②Execute in the bin directory MYSQL8 is the service name you choose. You can define the name yourself, as long as it is different from the original MySQL service. ③After the installation is complete, execute (your own service name) 3. Results Enter (If you want to change the password, execute ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new password';) Cheers! 8.0.15 was installed successfully! Then my sql was executed perfectly! Problem solved! Summarize The above is a detailed tutorial on how to install different (two) versions of MySQL database on Windows. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you! You may also be interested in:
|
<<: Summary of uncommon operators and operators in js
>>: Implementation example of nginx access control
union execution For ease of analysis, use the fol...
The first solution is to push the image to a publ...
vsftpd Overview vsftpd is the abbreviation of &qu...
If your DOCTYPE is as follows: Copy code The code ...
Table of contents 1. Location / Matching 2. Locat...
How to solve the problem of being unable to acces...
Table of contents What is a Mapping Difference be...
Table of contents 1. What is the use of provide/i...
Table of contents 1. Introduction 2. MVCC (Multi-...
What is a table? Table is an Html table, a carrie...
To achieve the background color flashing effect, j...
Conclusion: In a multithreaded environment, if on...
Preface It took two days to reconstruct a puzzle ...
This article uses an example to illustrate the us...
First, your container must be running You can vie...