To learn about mysql databases, you must first master frequently used mysql commands. The following describes nine frequently used mysql commands, which may help you learn frequently used mysql commands.
1. start the MYSQL service. net start mysql
Stop MYSQL service. net stop mysql
2. netstat-na | findstr 3306: Check the listening port. findstr is used to check whether the following port exists.
3. log on to the MYSQL console using the mysql commend line tool.
Syntax format: mysql-user = root-password = 123456 db_name
Or mysql-uroot-p123456 db_name
4. After Entering the MYSQL command line tool, use status; or \ s to view the running environment information
5. Switch the database connection Syntax: use new_dbname;
6. display all databases: show databases;
7. display all tables in the database: show tables;
8. show all information about a table: show create table table_name;
9. view the specific attribute information of the table and the description of each field in the table.
Describe table_name; Abbreviation: desc table_name;
The preceding section describes common mysql commands.
Common MySQL auto-increment Fields
Mysql character encoding method
Statement for modifying fields in mysql
How to delete multiple tables in MySQL
How MySQL connects to remote SQL