Home  >  Article  >  Database  >  MYSQL命令行小技巧_MySQL

MYSQL命令行小技巧_MySQL

WBOY
WBOYOriginal
2016-06-01 13:38:541004browse

bitsCN.com


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;
 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn