mysql 第一次启动及常用命令



启动

mysql -u root -p

进入后

# 显示有几个数据库
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

# 切换数据库
mysql> use mysql
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> show tables;
# 不用再切换表了 直接使用
mysql> select * from user;



猜你喜欢

转载自www.cnblogs.com/wangjiale1024/p/10266065.html