MySQL is used in Windows 64-bit system on the fourth day, and MySQL on the fourth day
1. Start/Close MySQL
(1) Start the 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.
The above is all the content of this article, hoping to help you learn.
Related Articles:
MySQL first came into contact with MySQL on the first day of study
Install and configure MySQL winx64 the next day
MySQL verification in Windows 64-bit operating system on the third day
Thank you for reading this article. Make sure that you keep up your efforts!