C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql -h 120.77.240.10 -P 3306 -u yanyu -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5858
Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| soft01 |
| soft02 |
| soft03 |
| sys |
| yanyu |
+--------------------+
8 rows in set (0.01 sec)
mysql> use soft03
Database changed
mysql> show tables;
Empty set (0.01 sec)
mysql>
mysql>
mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| soft01 |
| soft02 |
| soft03 |
| sys |
| yanyu |
+--------------------+
8 rows in set (0.01 sec)
mysql> use soft03
Database changed
mysql> select databse();
ERROR 1305 (42000): FUNCTION soft03.databse does not exist
mysql> select database();
+------------+
| database() |
+------------+
| soft03 |
+------------+
1 row in set (0.01 sec)
mysql> show tables;
+------------------+
| Tables_in_soft03 |
+------------------+
| cao |
| user |
| user01 |
| user02 |
| user07 |
| user10 |
| user12 |
| user13 |
| user20 |
| user22 |
| user25 |
| user26 |
| user32 |
| user36 |
| user44 |
| user50 |
| user51 |
| user58 |
+------------------+
18 rows in set (0.01 sec)
mysql> desc user1;
ERROR 1146 (42S02): Table 'soft03.user1' doesn't exist
mysql> desc user01;
+-------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| id | int(11) | NO | | NULL | |
| name | varchar(255) | YES | | NULL | |
+-------+--------------+------+-----+---------+-------+
2 rows in set (0.02 sec)
mysql> insert into user01 values(
-> 'aad','wefre');
ERROR 1366 (HY000): Incorrect integer value: 'aad' for column 'id' at row 1
mysql> insert into user01 values(
-> 1,'yanyu');
Query OK, 1 row affected (0.01 sec)
mysql> select * from user01;
+----+-------+
| id | name |
+----+-------+
| 1 | yanyu |
| 1 | yanyu |
+----+-------+
2 rows in set (0.01 sec)
mysql> select * from user01;
+----+-------+
| id | name |
+----+-------+
| 1 | yanyu |
| 1 | yanyu |
+----+-------+
2 rows in set (0.01 sec)
mysql> update user01 set name = 'yanyu666';
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> select * from user01;
+----+----------+
| id | name |
+----+----------+
| 1 | yanyu666 |
| 1 | yanyu666 |
+----+----------+
2 rows in set (0.01 sec)
mysql> insert into user01 values(
-> 100,'yanyu');
Query OK, 1 row affected (0.02 sec)
mysql> select * from user01;
+-----+----------+
| id | name |
+-----+----------+
| 1 | yanyu666 |
| 1 | yanyu666 |
| 100 | yanyu |
+-----+----------+
3 rows in set (0.01 sec)
mysql> update user01 set name = 'yanyu123';
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> select * from user01;
+-----+----------+
| id | name |
+-----+----------+
| 1 | yanyu123 |
| 1 | yanyu123 |
| 100 | yanyu123 |
+-----+----------+
3 rows in set (0.01 sec)
mysql> update user01 set name = 'yanyu666'where id = 100;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from user01;
+-----+----------+
| id | name |
+-----+----------+
| 1 | yanyu123 |
| 1 | yanyu123 |
| 100 | yanyu666 |
+-----+----------+
3 rows in set (0.01 sec)
mysql> delete * from user01;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* from user01' at line 1
mysql> delete from user01;
Query OK, 3 rows affected (0.01 sec)
mysql> select * from user01;
Empty set (0.01 sec)
mysql> insert into user01 values(
-> 1,'yanyu1');
Query OK, 1 row affected (0.01 sec)
mysql> insert into user01 values(
-> 2,'yanyu66');
Query OK, 1 row affected (0.01 sec)
mysql> select * from user01;
+----+---------+
| id | name |
+----+---------+
| 1 | yanyu1 |
| 2 | yanyu66 |
+----+---------+
2 rows in set (0.01 sec)
mysql> delete from user01 where id = 1;
Query OK, 1 row affected (0.01 sec)
mysql> select * from user01;
+----+---------+
| id | name |
+----+---------+
| 2 | yanyu66 |
+----+---------+
1 row in set (0.01 sec)
mysql>