This article shares the installation tutorial of MySQL 5.7.21 for your reference. The specific contents are as follows Installation Environment Windows version: Windows 7 Professional 64bit Before installing MySQL, please make sure that the net command on your computer is working properly. Some Windows systems may be missing the net command (environment variable missing). Installation Process 1. Download MySQL Community Server 2. Unzip and "reasonably place" MySQL Server 3. Configure environment variables for MySQL Server ---In the "User variables" section, select "New". In the dialog box that opens, write MySQL as the variable name and the full path of the MySQL folder (D:\MYSQL\mysql-5.7.21-winx64) as the variable value. ---Look for the PATH environment variable in the User section, if it is there, click "Edit". Use a semicolon at the end of the variable value; to separate it, then add %MySQL%\bin; 4. Register MySQL service -----cd to the bin folder of the folder where MySQL Server is located----------------mysqld -install command, register MySQL service 5. Create the my.ini file in the MySQL directory (D:\MYSQL\mysql-5.7.21-winx64) with the following content: [mysql] # Set the default character set of the mysql client to default-character-set=utf8 [mysqld] #Set port 3306 port = 3306 # Set the installation directory of mysql to basedir=F:\mysql-5.7.21-winx64 # Set the storage directory of mysql database data datadir=F:\mysql-5.7.21-winx64\data # Maximum number of connections allowed max_connections=200 # The default character set used by the server is the 8-bit latin1 character set character-set-server=utf8 # The default storage engine that will be used when creating a new table default-storage-engine=INNODB sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 6. Generate data directory: ----In the "Command Prompt" just now, execute mysqld --initialize 7. Start MySQL Server ----Execute net start mysql in the "Command Prompt" to start MySQL Server 8. Configure the MySQL root account. In the Command Prompt, execute net stop mysql to shut down the MySQL Server. Then execute mysqld --skip-grant-tables to start the password-less MySQL Server. Open a new Command Prompt and execute mysql -u root to log in to the MySQL Server. Run the flush privileges command to refresh permissions. Execute grant all privileges on *.* to 'root'@'localhost' identified by 'the password you want to set' with grant option;. Run the flush privileges command to refresh the new root user password. Execute exit to exit MySQL. Run net start mysql in the Command Prompt to restart MySQL Server, and then use mysql -u root -p again with the password you set to log in to MySQL securely. 9. Possible problems: After installing mysql, I changed the ROOT password and used net start mysql ------ and it said that it could not be started Solution: Execute mysqladmin -u root -p shutdown and enter the set password to start successfully The above command line must be opened with administrator privileges . Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for various versions of MySQL 5.7 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:
|
<<: Detailed steps for installing Harbor, a private Docker repository
>>: How to use JS to parse the excel content in the clipboard
Table of contents Preparation Install VMware Work...
Inline format <colgroup>...</colgroup>...
Table of contents JSON.parse JSON.parse Syntax re...
Description: Change the carriage return in the tex...
Table of contents 1. List interface and other mod...
Border Style The border-style property specifies ...
Table of contents Date Object Creating a Date Obj...
A reader contacted me and asked why there were pr...
Table of contents 1. The reason why the limit is ...
A master once said that you should know the datab...
Password Mode PDO::__construct(): The server requ...
Method 1: SET GLOBAL general_log = 'OFF';...
Table of contents Install Dependencies Configurat...
The marquee element can achieve simple font (image...
1. Install Apache # yum install -y httpd httpd-de...