#!/bin/bash
date +'%F %T'
echo "Show Database"
mysql -u [user] -p[password] -e 'SHOW DATABASES,USE eventime,SELECT * FROM dt;'
输出
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
我不知道为什么不选择数据 需要连接和选择数据 并在90天前删除数据eveytime 请求帮助。
答案 0 :(得分:2)
在命令中尝试使用分号而不是逗号 -
mysql -u [user] -p[password] -e 'SHOW DATABASES;USE eventime;SELECT * FROM dt;'