您的位置:首页 > 运维架构 > Linux

linux登陆mysql数据库

2016-06-03 10:47 537 查看
mysql登录的方式是这样的:

[root@crmtestdb root]#mysql -u root -h 127.0.0.1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.45-community MySQL Community Edition (GPL)

Type ''help;'' or ''\h'' for help. Type ''\c'' to clear the buffer.

mysql>


 

如果有密码的话,登录方式为:

 mysql -u root -h 127.0.0.1 -p

至于该使用哪个数据库,使用哪个,应该是这样:

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| test               |

| wt                 |

+--------------------+

4 rows in set (0.00 sec)

mysql> use test

Database changed

mysql>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: