All of the following steps are done using the command line to complete the operation of the MySQL service.
one start/close MySQL (1) Start MySQL service
net start MySQL
(2) Stop MySQL service
net stop MySQL
Two log in/out of MySQL
First, let's take a look at some important MySQL parameters, and some important MySQL parameters are listed in the following table:
(1) View version number
Enter Mysql-v or MySQL--version, note that the-V here is uppercase.
(2) log in to MySQL
MySQL will have to add parameters after the line. The format is: mysql-u root (user)-p-p port number-H mysql hostname \ip (Local machine loopback address). Such as
Input: Mysql-u root-p-P 3306-h 127.0.0.1, enter password after login;
If the command line is the native of MySQL, and with the default port of 3306, direct input: Mysql-u root-p, and then enter the password.
(3) MySQL exit
Enter any one of the following to exit the MySQL service.
mysql> exit;
Mysql> quit;
Mysql> \q (note here is the backslash);
Here I tried all three, can quit the MySQL service, the following is the input: exit;
Three modify MySQL prompt
Let's take a look at the prompt we often use:
Before you change, take a look at the default MySQL prompt:
(1) specify by parameter when connecting to client
The format is: Mysql-u root-p--prompt prompt, for example we input: Mysql-u root-p--prompt \h
(2) after connecting the client, modify by prompt command
The format is: Mysql>prompt prompt, for example we enter: Mysql>prompt \u, then enter again: Prompt \[email protected]\h \d>
Let's start by using the command to enter a database to see the results, input: use test;
four MySQL common commands (1) Show current server version
SELECT VERSION ();
(2) display the current date and time SELECT now ();
(3) Show current user
SELECT USER ();
Five MySQL statement specification
(1) The keyword and function name are all uppercase (even if written in lowercase, but in order to differentiate, the recommended keyword and function name all uppercase).
(2) Database name, table name, field name all lowercase.
(3) The SQL statement must end with a semicolon.
MySQL Learning 4:windows 64-bit operating system using MySQL