Home >Database >Mysql Tutorial >Commonly used basic operation syntax of mysql (1) ~~Operation of the library [command line mode]

Commonly used basic operation syntax of mysql (1) ~~Operation of the library [command line mode]

黄舟
黄舟Original
2017-03-03 13:50:541347browse

1. Create a database: create Database databaseName; For example, if you need to create a mysqlTest database, create Database mysqlTest;



## by It can also be seen that the name here is not case-sensitive. As far as I know, it can be set to all uppercase or all lowercase through the settings.

2. View existing databases in the system: show databases;


3. Select a database: use databaseName;(all databaseName in this article Both are a code name, representing the database name, tableName is also a code name, representing the table name);



4. Delete the database: drop database databaseName;


5. View database engine: show engines \G


Support There are many engines, so the screenshots here are incomplete.

6. View the database default storage engine: show variables like 'storage_engine%';



##7 , View system help: help contents;


8. Create table: create table tableName(

Attribute name data type,

Attribute name data type,

......

)

9. View the table structure: describe tableName;



10. Delete table: drop table tableName;


The above is the content of the common basic operation syntax of mysql (1)~~Operation of the library [command line mode]. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn