MYSQL命令行小技巧
MYSQL 連接方式
www.2cto.com
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;