从MySQL 5.5命令行客户端访问phpmyadmin上的数据库?

时间:2012-11-17 20:19:01

标签: mysql database command-line phpmyadmin

有没有办法从MySQL命令行访问和管理我的phpMyAdmin数据库?

1 个答案:

答案 0 :(得分:2)

在* nix站上设置类似BASH的shell:

mysql -h<hostname> -u<username> -p<password>

可以跳过localh的-h。如果您正在处理远程主机,则必须将其配置为侦听外部接口,并且您必须能够访问远程主机上该接口上的端口3306。用户名是root或特定于数据库/模式的密码。

12:02:26 justin@justin-4320s:~
$ mysql -htiny -uroot -p################
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2710
Server version: 5.5.28-0ubuntu0.12.10.1-log (Ubuntu)

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| Assessor           |
| mysql              |
| performance_schema |
| test               |
| ... contd.         |
+--------------------+
12 rows in set (0.10 sec)

mysql>