2011-09-16 14 views

答えて

9

mysql — the MySQL command-line toolに '--execute = statement'または '-e statement'オプションを指定してください。

勧告は、ユーザー&パスワード入力&データベース @devartsの
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 
関連する問題