To establish a database:
mysql> CREATE DATABASE test; Create a database named "Test"
To create a database table:
Mysql> CREATE TABLE Test
(name char (+) NOT NULL,
-passwd char (16)
); Create a table named "Test" with two fields, a field named "Name", type char, size 16, non-null, another field named "Passwd", and a char type with a size of 16, which can be empty.
To find elements in a table:
Mysql> select * from test; Finds all the elements in the "test" table.
To insert an element into a table:
mysql> INSERT into test values (' ASD ', ' 123 '); Insert this data into the "test" table with the name "ASD" and passwd as "123".
To delete an element in a table:
mysql> Delete from test where name= ' ÁSD '; Delete the data in the "test" table with the name "ASD".
To modify an element in a table:
mysql> Update test set passwd= "111" where name= "ASD"//the "test" table, the password for "ASD" is changed to "111".
To modify the database password:
Mysql> set Password=password (' 123456 '); Set the database password to 123465.