語法:show databases;
mysql> show databases;
+----------------------+
| Database |
+----------------------+
| information_schema |
| jdbc_xiangyang_liao1 |
| my_jdbc |
| myfirstdb |
| mysql |
| performance_schema |
| sys |
+----------------------+
7 rows in set (0.02 sec)
語法:create database 庫名;
mysql> create database new_cre;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+----------------------+
| Database |
+----------------------+
| information_schema |
| jdbc_xiangyang_liao1 |
| my_jdbc |
| myfirstdb |
| mysql |
| new_cre |
| performance_schema |
| sys |
+----------------------+
8 rows in set (0.00 sec)
語法:use 庫名;
mysql> use my_jdbc;
Database changed
語法:show tables;
mysql> show tables;
+-------------------+
| Tables_in_my_jdbc |
+-------------------+
| my_jd |
| my_jdbc |
| student |
| ww |
| www |
| wwwww |
+-------------------+
6 rows in set (0.01 sec)
語法:select * from 表名;
mysql> select * from my_jdbc;
+------+----+------+
| name | id | pass |
+------+----+------+
| w | 1 | 111 |
+------+----+------+
1 row in set (0.01 sec)