时间:2021-07-01 10:21:17 帮助过:26人阅读
MYSQL命令行小技巧
MYSQL 连接方式
1 先登录数据库 再查询
#mysql -uroot -p -hlocalhost
Enter Password:
mysql>use mysql;
Database changed
mysql>select user from user;
2 不进入MYSQL DB直接进行查询工作
#mysql -uroot -p -e"select user from user;" user
Enter Password:
+------+
| user |
+------+
| root |
| root |
+------+
回滚和提交事物命令
commit;
rollback;