First, download the MySQL website
Open official Website address: www.mysql.com, select DOWNLOADS, go to the MySQL download page, at the bottom of the page there is a MySQL Community Edition, and there is a blue link below
Click to go to the download page:
Click to enter, select the download version to download, the page is as follows:
Second, MYSQL configuration
After the download is complete, it is a zip file, put it in the location you want to place, such as the D drive, unzip the software to the current folder.
1. Open our extracted folder, is the Mysql-5.7.20-winx64 folder under the D disk, create a new My.ini file under the Mysql-5.7.20-winx64 folder.
Open with Notepad and enter the relevant configuration information:
[Client]
port=3306
Default-character-set=utf8
[Mysqld]
# Set the installation directory for your MySQL
Basedir=d:\mysql-5.7.20-winx64
# Data Directory set to MySQL
Datadir=d:\mysql-5.7.20-winx64\data
port=3306
Character_set_server=utf8
Sql_mode=no_engine_substitution,no_auto_create_user
#开启查询缓存
Explicit_defaults_for_timestamp=true
Skip-grant-tables
The configuration is complete, save the My.ini file.
2. To the installation file bin input, use cmd Run command, here must run cmd (Shift + right mouse button).
3. Configuration
First enter the mysqld--initialize Command, which represents initializing MySQL and generating files from the Data folder. If there is no error, it means initialization is complete.
Enter the mysqld-install command to install MySQL. If there is a service successfully installed the registration is successful because my registration is OK, so it appears, already exists.
Now can finally start the server out of the net start MySQL command to start the server, if the first time the service failed, choose to restart the server to try. Shut down the server with net stop MySQL
Second, MySQL Login and Logout
This involves the common parameters of the MySQL command:-u:u represents username, which represents the user name; -p:p represents password, which indicates the login password;-h:host-name hostname;-p:port port.
So we want to log in to MySQL, need to provide user name, password, hostname, port number information. Syntax MySQL [-u username] [-h host] [-p[password]]; After installing MySQL, we will get the initial username root, but no initial password, but what do I do with the password? We just type MySQL. If you access the local server and use MySQL's default port,-H and-p may not be written. Now let's log in and start the MySQL server first. This is also where you run PowerShell as an administrator.
When we enter Mysql-u root-p in the command line, we are prompted to enter the password, then enter MySQL, you can log in to MySQL.
Windows Server MySQL Database installation configuration