Download and install MySQL Tutorial

1. Download the MySQL database can visit the official website: https: //www.mysql.com/

 

 2. Click Modules under Community under the DOWNLOADS module MySQL Community Server to download.

 

 

  • Due to the latest version is: MySQL Community Server 5.7.21
  • Bo Friends of the recommended download version of history, the Bo downloaded 5.6.39
  • Download steps:
  • Enter, select MySQL version and host

 

 

  • According to their own computer select the appropriate digits for download, this machine is 64-bit, click download.

 

 

  • Go to the next page that MySQL need to register an account, or not to register, direct download.

 

 

 

 

3. Configure MySQL database, configuration steps:

 

MySQL installation files are divided into two types, one is the msi format, one is zip format. zip format their own decompression, decompression after the fact, you can use MySQL, but should be configured.
If the user is not configured directly using MySQL, but the error icon will appear. This is because there is no configuration environment variable due. Configuration environment variable is very simple:

My Computer -> Properties -> Advanced -> Environment Variables

Select the PATH, add it back: the path to your mysql bin folder: D: \ Program Files \ JavaTool \ MySQL \ mysql-5.6.39-winx64 \ bin

 

 

After you finish configuring environment variables, but also need to modify the configuration file (if not configured, when it will start after the figure mistakes Oh:! 2 error system can not find the file), mysql-5.6.1X default configuration file is in D: \ Program files \ JavaTool \ MySQL \ mysql-5.6.39-winx64my-default.ini, or their own to create a my.ini file.

Modify or add configuration in which:

basedir = D: \ Program Files \ JavaTool \ MySQL \ mysql-5.6.39-winx64 (mysql directory) 

datadir = D: \ Program Files \ JavaTool \ MySQL \ mysql-5.6.39-winx64 \ data (mysql directory \ data)

Note: encoding my.ini file must be encoded in English (e.g., ANSI windows), the other can not be UTF-8 or GBK.

 

 

Run as administrator cmd (must use the Run as Administrator, or enough authority),

Enter the command: cd D: \ Program Files \ JavaTool \ MySQL \ mysql-5.6.39-winx64 \ bin into the mysql bin folder (with or without variable-configured environment, but also into the bin folder, otherwise after starting the service is still will be reported error 2)

Enter mysqld -install (if not running as administrator, will be because of insufficient permissions error:! Of the Service Denied Install / Remove) 

 

 

 

 Successful installation

 

 

  • Start the service, enter the command: net start mysql.
  • Starts successfully shown in FIG.

 

 

 

  • After the service starts successfully, enter the command: mysql -u root -p (first log on without a password, press the Enter directly over)!

 

 

  • Enter directly, as shown, the login is successful.

Error Summary:

If the service starts, an error, see Note:

2 and this time make the mistake error 1067 may occur.

If "System error 2 file not found", check to see if the modified configuration file or whether to enter operation in the bin directory, and if the right to modify the configuration file into the bin folder, you need to delete mysql (input mysqld -remove) appear and then reinstall (input mysqld -install);
if there is an error 1067, it is wrong to modify the configuration file, confirm the configuration file is correct.

Guess you like

Origin www.cnblogs.com/pypypy/p/11806632.html
Recommended