All of the following steps are performed using the command line method. 1. Start and close MySQL (1) Start MySQL service netstartmysql (2) Stop MySQL service netstopmysql 2. log on and exit MySQL. First, let's take a look at some important mysql parameters, the following table lists some important mysql parameters: (1) view the version number.
All of the following steps are performed using the command line method. 1. start/stop MySQL (1) start MySQL service. net start mysql (2) stop MySQL service. net stop mysql 2. Log On/exit MySQL. First, let's take a look at some important mysql parameters, the following table lists some important mysql parameters: (1) view the version number.
All of the following steps are performed using the command line method.
1. Start/Close MySQL (1) Start MySQL Service
Net start mysql
(2) Stop the MySQL Service
Net stop mysql
2. log on to/out of MySQL
First, let's take a look at some important mysql parameters. The following table lists some important mysql parameters:
(1) view the version number
Enter mysql-V or mysql -- version. Note that-V is in uppercase.
(2) log on to MySQL
You must add parameters after mysql. Format: mysql-u root (User)-p-P port number-h mysql host name \ ip (Local Machine return address ). For example
Enter mysql-u root-p-P 3306-h 127.0.0.1, press enter, and enter the password to log on;
If the command line is the local machine where mysql is located and the default port is 3306, enter mysql-u root-p directly, and then enter the password.
(3) Exit MySQL
Enter any of the following to exit the MySQL service.
Mysql> exit;
Mysql> quit;
Mysql> \ q (note that the backslash is used here );
Here all three of my attempts can exit the MySQL service. The following is the input: exit;
3. Modify the MySQL prompt
Let's take a look at the frequently used prompt:
Before modifying the settings, check the default MySQL prompt:
(1) Specify parameters when connecting to the client
Format: mysql-u root-p -- prompt. For example, enter mysql-u root-p -- prompt \ h.
(2) After connecting to the client, use the prompt command to modify
The format is: mysql> prompt. For example, enter mysql> prompt \ u, and then enter prompt \ u @ \ h \ d> again.
Run the command to enter a database and check the result. Enter: USE test;
Iv. MySQL Common commands (1) display the current server version
Select version ();
(2) display the current date and time select now ();
(3) display the current user
Select user ();
V. MySQL statement Specification
(1) All keywords and function names are in upper case (even if they are written in lower case, but to distinguish them, we recommend that all keywords and function names be in upper case ).
(2) The database name, table name, and field name are all in lowercase.
(3) The SQL statement must end with a semicolon.