First, download
Download: https://dev.mysql.com/downloads/mysql/
Second, the configuration
1. mysql extract the downloaded installation package, my-default.ini decompressed file in the directory are copied to the same directory, rename my.ini file, and then modify the contents of the file, as follows:
2. Configure environment variables, D: \ mysql \ mysql-5.7.17-winx64 \ bin directory to the next Path.
Third, the installation
1. administrator mode to open the dos command line, go to the bin directory of mysql.
2. initialization data, execute the command: mysqld --initialize-in the insecure (no space behind the front spaces)
Then generates data folder size 120M is correct.
3. Install mysql service: mysqld install
4. Start mysql, in two ways:
Method 1: net start mysql
Second way: directly start the service list
Fourth, to verify whether the successful installation of mysql
Restart dos command line, enter the command: mysql -uroot -p
If this screen appears, mysql installation was successful.
appendix:
1. Stop the service through the command line.
2. Remove Service
3.mysql commonly used commands:
- show databases; # show all databases
- create database test; # create a database named test.
- use test; represents the use of test database.
- create table student (id int primary key auto_increment, sname varchar (20), birthday date); # Create a student, primary keys automatically increase.
- Data Insert: insert into student (sname, birthday) values ( 'zhangsan', '1989-12-23');