This article records the specific steps for downloading and installing MySQL 8.0.15 for your reference. The specific contents are as follows Background: A tutorial written as a product that loves technology but doesn’t understand code 1. Environment System: Windows 64 bit 2. Download First, download the database installation file, go to the MySQL official website download channel https://www.mysql.com/downloads/, and click Community→MySQL Community Server, as shown below: After entering the download page, select the operating system. Here we choose the default Microsoft Windows system. Find the version that suits your system below. I choose 64-bit download here. Click Download to start downloading, as shown below: What is downloaded here is a ZIP compressed package. After downloading it locally, you can directly decompress it to the corresponding directory. 3. Installation ps: After unzipping the downloaded ZIP compressed package to the corresponding directory, open the installation directory. There should be no data folder and my.ini file in the directory. 3.1 Configure environment variables Before installation, you need to configure the environment variables. Right-click "My Computer → Properties → Advanced System Settings → Advanced → Environment Variables → System Variables", find the path variable and double-click it, or click Edit, the Edit System Variable pop-up window will pop up, add the installation path of MySQL to the variable value, and the path should be accurate to the bin directory under the installation directory. 3.2 Add configuration file Create a new document in the unzipped mysql directory, open it, and copy and paste the following code: [mysqld] # Set port 3306 port=3306 # Set the installation directory of mysql basedir=D:\\Program Files\\mysql-8.0.15-winx64 # Set the storage directory for mysql database data# datadir= # 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=UTF8MB4 # 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=UTF8MB4 [client] # Set the default port used by the mysql client to connect to the server port = 3306 default-character-set=UTF8MB4 Modify the value of basedir and set it to the installation directory of mysql. The above is my installation directory. Everyone should set it according to their actual directory. After the settings are completed, click Save and save the file name as my.ini. The file configuration is complete! 3.3 Initialize the database Run cmd as an administrator. This is a good idea. cmd is in a directory on the C drive by default. First, you need to return to the root directory of the C drive, and then enter the bin directory of mysql. The operation is as follows:
After entering the mysql directory, enter mysqld --initialize --console to initialize the database. The correct response should be the following information. Note that the string after root@localhost needs to be written down as it will be used later. OK, it seems to be going smoothly here, but it took me a lot of effort to install it. Now I would like to share with you some problems that occurred during the installation process: 1. During initialization, I entered mysql --initialize --console, and an error message appeared: unknown option --initialize. Did you see the problem? It was a very basic mistake. I wrote mysqld as mysql. I was very depressed. It was not mysql. When did they add a small d? But it is like this. Just remember it. 2. Post the question directly I was confused. There was a warning and two errors. OK, let's check them one by one. Warning: I read it with my half-baked English level and felt that the problem was with the encoding. It asked me to use UTF8MB4. I remembered that there was encoding in the configuration file, so I changed it. Please go up to 3.2 here and change all UTF8 places in the my.ini file to UTF8MB4, save and reinitialize. Error: It seems that a file already exists. From the tone, it seems that it should not exist, so it is asked to be thrown away. The second error directly says to throw it away. Okay, I just searched on Baidu and found that the data directory was automatically generated in the MySQL installation directory (note that there is no such file in the original file downloaded and unzipped). At this time, just delete the data directory and re-run the initialization statement, and it's done! 3.4 Installation Service Next, install the service using mysqld --install [service name]. The service name can be omitted. The default name is mysql. If multiple services are installed on the computer, you can use different names to distinguish them. The successful installation prompt is as shown below: If the service has been installed, it will prompt "the service already exists!". Start the service Start the MySQL service using the command net start mysql. OK, finished! Wonderful topic sharing: MySQL different versions installation tutorial MySQL 5.7 installation tutorials for various versions MySQL 5.6 installation tutorials for various versions mysql8.0 installation tutorials for various 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:
|
<<: Vue.js implements music player
>>: There is no problem with the Linux file path when deploying the window and Linux projects
Online shopping mall database-product category da...
The img tag in XHTML should be written like this:...
Recently, due to work needs, I need to format num...
Awk is an application for processing text files, ...
A set of projects for training react+ts Although ...
<br />Before browsers can handle the next ge...
This article shares with you the installation tut...
Table of contents 1. What is block scope? 2. Why ...
Differences between Docker and Docker Machine Doc...
<br />What principles should be followed to ...
1. Time types are divided into: 1. Network time (...
MySQL has multiple ways to import multiple .sql f...
The VMware Workstation Pro version I use is: 1. F...
Preface The computer I use is a Mac, and the oper...
Table of contents Preface Descriptors Detailed ex...