2016-09-22 4 views
0
#!/bin/bash 
date +'%F %T' 
echo "Show Database" 
mysql -u [user] -p[password] -e 'SHOW DATABASES,USE eventime,SELECT * FROM dt;' 

出力から、データベースのMySQLを接続する必要があります。データを選択しない理由を私は知らないシェルスクリプト(Linuxのcentos7)

2016-09-22 16:01:33 
Show Database 
Warning: Using a password on the command line interface can be insecure. 
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USE eventime,SELECT * FROM dt' at line 1 

接続して、選択したデータ をし、データeveytimeを削除する必要があります90日前 thx for help。コマンド内のコンマの代わりに

答えて

2

てみセミコロン -

mysql -u [user] -p[password] -e 'SHOW DATABASES;USE eventime;SELECT * FROM dt;' 
関連する問題