![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
如何登录mysql
登录的方式:
[root@crmtestdb root]# su - mysql
-bash-2.05b$ 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>
广告 您可能关注的内容 |