I will be learning MySQL next semester. I didn't practice it at home beforehand. I didn't expect that it would take me a long time to install it, so I decided to organize it for your reference. The first step is to download the installation package: Official Website After all, it is a product of Oracle, and it is really slow to download it from the official website! There are two options here, I suggest you choose the first one (because I downloaded the second one first, but it failed, I don't know why it always goes wrong.) After downloading, choose a path to decompress it. The second step is to configure my.ini: Create a new text file in the root directory and copy the following content. Note that the suffix should be changed to .ini [mysqld] # Set port 3306 port=3306 # Set the mysql installation directory basedir=C:\Program Files\mysql-8.0.18-winx64 # Set the storage directory of mysql database data datadir=C:\Program Files\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=utf8 # 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 [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 = 3306 default-character-set=utf8 The third step is to configure the environment variables: 1. Create a new system variable: (the variable value is the path, modify it according to your own situation) 2. Then add the last line in the following figure to the path of the system variable (note there is a semicolon at the end) The third step is to initialize and start: 1. Open cmd as an administrator (must be opened as an administrator), cd to the bin directory of the mysql folder, jo)?/kia(k4>B is the password. It is recommended to copy and save it. There is an error here. It does not affect the installation. Don't worry about it for now (I finally found that the reason is the problem of my.ini file. The one I gave above is fine) If a pop-up window prompts: "MySQL: Code execution cannot continue because VCRUNTIME140_1.dll was not found. Reinstalling the program may resolve this issue." Solution: Download the "Microsoft Common Runtime Library Collection", unzip it directly after downloading, and the problem can be solved (just search and download it on Baidu). 2. Install MySQL service: mysqld --install 3. The command to start the server is: net start mysql. In addition, the command to stop the service is: net stop mysql. Uninstall MySQL service command: sc delete MySQL/mysqld -remove 4. Log in to the database, you will be asked to enter the password Change the password after logging in: For example, change the password to: 123456 set password for root@localhost='123456'; 5. Display database show databases; When you see the above results, it means that MySQL has been correctly installed on your computer. 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:
|
>>: 13 JavaScript one-liners that will make you look like an expert
Subquery in MySql database: Subquery: nesting ano...
<br />This is not only an era of information...
1. Big Data and Hadoop To study and learn about b...
The main functions are as follows: Add product in...
Table of contents 1. Generate a certificate 2. En...
Preface: I wrote this because I helped my friend ...
Table of contents Installation Prerequisites Step...
background This article mainly tests whether the ...
Preface This article is quite detailed and even a...
After setting the iframe's src to 'about:b...
Table of contents Stabilization Introduction Anti...
Find the problem Recently, I found a problem at w...
Preface If you frequently access many different r...
Table of contents background How does element-ui&...
aforementioned This article is very short~ The ma...