preface

1. Start and stop the MySQL service

(Right-click to open the command prompt as an administrator.)

Enter the command: net start mysql to start the service

Summary of a MySQL knowledge map to share with you:

Enter the command: net stop mysql to shut down the service

2. Log in to and log out of MySQL

MySQL 2.0 parameters

2.1 the MySQL login

Enter the command parameters: mysql -u root -p

MySQL 2.2 quit

Input parameters:

3. Modify the MySQL prompt

Method 1: Set parameters when connecting to the client

After logging in to MySQL, the original prompt should be [> MySQL], we change it to [localhost] with the following command:

Mysql -uroot -proot –prompt -\h

Method 2: After connecting to the client, run the prompt command to modify the configuration file

prompt mysql>

At this point, the prompt will be changed to mysql>

4. Common commands

1. Display the version of the current server

SELECT VERSION();

2. Display the current date and time

SELECT NOW();

3. The current user is displayed

SELECT USER();

5. MySQL statement specification

[keyword] and [function] name all uppercase

【 database 】 name, 【 table 】 name, 【 field 】 name all lowercase

[SQL] statements must start with [;] At the end

The last

I have compiled a MySQL database document Java systematic information (including Java core knowledge, Spring series of family, interview topics and 21 years of the latest Internet real questions, e-books, etc.) friends who need to pay attention to the public number [procedure Yuan small wan] can be obtained.