Mysql-SSH连接

Mysql-SSH连接

用户(test)指定SSH连接Mysql

mysql -u test -p

确认当前连接的数据库(未连接任何DB)

mysql>  SELECT database();
+------------+
| database() |
+------------+
| NULL       |
+------------+
1 row in set (0.00 sec)

当前可选择数据库列表

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

选择数据库

mysql> use sample_db
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

结果确认

mysql> SELECT database();
+------------+
| database() |
+------------+
| sample_db  |
+------------+
1 row in set (0.00 sec)

猜你喜欢

转载自blog.csdn.net/oblily/article/details/86501769