Win+r open Run, input cmd
Go to MySQL |
Mysql–u root-p |
-uroot can be attached to write,-P can also be attached to the middle of the password without spaces,-and between you and P is not a blank, [-p][root][-u] can only be lowercase, u represents the user,p password.
Set Password |
Mysqladmin–u Root PASSWORD 789 |
The end of the SQL statement in MySQL must be added [;].
Display Database |
SHOW DATABASES; |
Deleting a database |
DROP dtabase Database name |
Create a new user and give it permission to operate on the database |
GRANT all privileges the database name. * To user name @localhost identified by password |
Operation permissions Create, SELECT, UPDATE, DELETE, or all permissions all privileges
Specify the database to use |
Use database name |
To display the database currently in use |
SELECT DATABASE (); |
Create a new table |
CREATE table table name (domain name data type column option); |
Note: The last domain name is not used [,].
Show all the tables |
SHOW TABLES; |
Show Table Structure |
DESC table name; |
Delete a table |
DROP table name; |
Inserting data into the table |
INSERT into table name (column name 1, column Name 2, ...) VALUES (data 1, Data 2,..); |
Displaying Data in a table |
SELECT column name 1, column Name 2, ... From table name |