Home >Database >Mysql Tutorial >How to install mysql version 5.7.21
Installation method of MySQL version 5.7.21: First download the mysql installation package and decompress it; then install and configure the environment variables, and after configuring, create a new file to hold the "my.ini" file; finally use the cmd command Just install, initialize and start the database.
Installation method of MySQL5.7.21 version: Download the mysql installation package and unzip it, then install and configure the environment variables. After configuration, create a new file to store my. ini file, and then install, initialize and start the database under the cmd command
[Recommended course: MySQL Tutorial]
The installation method of MySQL5.7.21 version is as follows
(1) To download the decompressed version of MySQL, download address: https://www.mysql.com/downloads/
(2) Unzip the installation package and customize the installation path. In this example, C:\software\ , so the full path of MySQL is: C:\software\mysql-5.7.21-winx64
(3) Configure environment variables and add system environment variables:
Key name: MYSQL_HOME
The value is: C:\software\mysql-5.7.21-winx64
[mysqld] port = 3306 basedir=C:/software/mysql-5.7.21-winx64 datadir=C:/software/mysql-5.7.21-winx64/data max_connections=200 character-set-server=utf8 default-storage-engine=INNODB sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [mysql] default-character-set=utf8Pay attention to this step : The red box is the installation path of MySQL, and use "/" instead of "\" between folders, otherwise errors may occur in the following operations
mysqld -installAfter executing the command, the prompt: Service successfully installed. Indicates successful installation (7) Execute the following statement to initialize MySQL
mysqld --initialize-insecure --user=mysqlAfter executing the command, the data directory will be generated in the MySQL installation directory and the root user will be created.
net start mysqlAfter execution, the following prompt will appear: The MySQL service is starting. . The MySQL service has been started successfully. (9) After starting MySQL, the password of the root user is empty. Set the password. The command is as follows: mysqladmin -u root -p password New password Enter password: Old password When you need to enter the old password, since the old password is empty, just press Enter. MySQL5.7.21 is installed. Summary: The above is the entire content of this article, I hope it will be helpful to everyone
The above is the detailed content of How to install mysql version 5.7.21. For more information, please follow other related articles on the PHP Chinese website!