有一天MYSQL发现,有这样的数据库:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| #mysql50#.ssh |
| mysql |
| performance_schema |
+--------------------+
或者drop database \#mysql50\#.ssh'又或者drop database \\#mysql50\\#\\.ssh
mysql> drop database #mysql50#.ssh;
ERROR : 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 '' at line 1
mysql> drop database "#mysql50#.ssh";
ERROR : 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 '"#mysql50#.ssh"' at line 1
都报错,后来发现,mysql用户的$HOME目录下有目录.ssh导致的问题。
su - mysql
pwd
ll .ssh
$rm -rf .ssh后,问题解决
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| #mysql50#.ssh |
| mysql |
| performance_schema |
+--------------------+
以为是哪位大神失误创建的
或者drop database \#mysql50\#.ssh'又或者drop database \\#mysql50\\#\\.ssh
mysql> drop database #mysql50#.ssh;
ERROR : 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 '' at line 1
mysql> drop database "#mysql50#.ssh";
ERROR : 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 '"#mysql50#.ssh"' at line 1
都报错,后来发现,mysql用户的$HOME目录下有目录.ssh导致的问题。
su - mysql
pwd
ll .ssh
$rm -rf .ssh后,问题解决
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+