Start MySQL service
start -> Computer -> Right select Manage -> double click to open Services and Applications -> double-click Services -> find the MySQL service name (mine is MySQL56), you can start right choice
To start the MySQL service via the command line
① Enter the start options bar "command prompt" -> right-click "Run as administrator"
② start MySQL service: net start MySQL server name
For example: net start MySQL56
③ Stop MySQL service: net stop MySQL server name
For example: NET STOP MySQL56
1
MySQL server login and exit
through the built-in MySQL client: the "MySQL 5.6 Command Line Client"
Login: Enter the root account password to login
Exit way: Enter the ctrl + c (directly enter, no semicolon)
Cons: This is fine for the root user login, other users can not, and therefore not flexible enough
Through Windows Client: Enter the start options bar "command prompt" -> right-click "Run as administrator" to open a command input box
Login: mysql -h host name -P port number -u user name -p Enter password to log in
For example: mysql -hlocalhost -P3306 -uroot -p password (behind the statement does not directly enter a semicolon)
If you log on the machine can be abbreviated as: mysq -u user name -p Enter password to log in
Exit way: exit (directly enter, no semicolon)
MySQL configuration environment variable
If you enter the login command in the above windows built-in client when prompted " 'mysql' is not an internal or external command, operable program
or batch file"; then the time is your environment variables not configured; look down:
Navigate to the bin directory where you installed MySQL installation, and path copy
computer - right click Properties - Advanced System Settings - Environment Variables - looking at the system environment variables inside Path- select and edit
pasted in front of the bin path just copied and state in English under the ";" at the back of the contents separated - OK - OK - OK
Note: the value of the Path is the front to back to find, you configure the command you want to open the window to turn off the rewriting to take effect
Writing specifications MySQL statements
are not case sensitive, uppercase keyword suggestion, table names, column names lowercase.
Each command ends the most use a semicolon; of course, "\ g" is also available.
Each command corresponding indentation and line breaks as needed
Notes
4.1: single-line comments: (no spaces between the # and the comment text) # comment text
Single-line comments: - (- space between text and comments) comment text
4.2: Multi-line comments: / * comment text * /
---------------------