2011-09-16 34 views

回答

4

您可以安装Windows的MySQL客户端,然后使用它将命令发送到服务器。

http://dev.mysql.com/doc/refman/5.0/en/mysql.html

可以使用下列类型的格式用于命令

MySQL的DB_NAME < script.sql> output.tab

壳>的MySQL --user = USER_NAME --password = your_password db_name

然后键入一个SQL语句,以“;”,\ g,o结尾r \ G并按下Enter键。

1

实际的例子推荐 输入您的用户密码& &数据库

mysql -uUSER -pPASSWORD -e 'SHOW DATABASES;' -- list databases 

mysql -uUSER -pPASSWORD MyDATABASE -e 'SHOW TABLES;' -- list tables in MyDATABASE 
1
Yes, We can access whole DB from command line. 
1. Connect to DB (no space between -p and password) 
    mysql -h <host> -u <username> -p<password> 
2. Now we can check how many db we have 
    show databases; 
or many more commands and even we can execute quires through command line. For more command details http://g2pc1.bu.edu/~qzpeng/manual/MySQL%20Commands.htm 
相关问题