centos7 命令行运行 mysql

1. 进入mysql

mysql -r -p

  

2. 展示所有数据库

show databases;

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| istester |
| mysql |
| performance_schema |
| sys |
+--------------------+

 

3. 进入某个库

mysql> use istester;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

 

4.查看当前所在数据库

mysql> select database();
+------------+
| database() |
+------------+
| istester   |
+------------+
1 row in set (0.00 sec)

 

5. 查看当前库下有哪些表

mysql> show tables;
+--------------------+
| Tables_in_istester |
+--------------------+
| idoxu              |
| istester           |
| istester2          |
+--------------------+
3 rows in set (0.03 sec)

 

centos7 命令行运行 mysql

上一篇:Oracle 迁移至 MySQL 的过程中遇到的一些问题及想法


下一篇:解决阿里云OSS The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint的办法