SHOW DATABASES; Show all databases
SHOW TABLES; Show all tables under the current database
CREATE DATABASE dbname; New Database
CREATE TABLE tbname (id BIGINT UNSIGNED, PRIMARY KEY (id)); To create a new table, you must have at least one column when you create a new data table, a field to be defined when new, a three-part (name data type other optional attribute), a comma between each field, and a primary key after the group of the field definition list, in which MySQL uses the primary key to organize the contents of the table.
Use dbname; Using the dbname Database
DESCRIBE Tbname; Display the contents of the Tbname table
INSERT into Tbname (title, article) VALUES ("Hello", "hahahahaha"); Insert content in table, title, article field defined by new table
SELECT * FROM tbname WHERE id = 1; Select the contents of the id=1 in the Tbname table, * is a wildcard, denotes all fields, the position of * can also be changed to other fields, where is the filter condition
SELECT * from Tbname WHERE title like "%test%"; Select the row with the title "Tset" in the table, and% to indicate the string wildcard character
DELETE from tbname WHERE id = 1; Delete rows with ID 1 in the pages table
MySQL basic commands