1. 程式人生 > >mysql資料庫中出現#mysql50#.ssh處理方法

mysql資料庫中出現#mysql50#.ssh處理方法

有一天MYSQL發現,有這樣的資料庫:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| #mysql50#.ssh      |
| mysql              |
| performance_schema |
+--------------------+

以為是哪位大神失誤建立的

想刪除這個資料庫試過使用drop database '#mysql50#.ssh'和 drop database #mysql50#.ssh;
或者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 |
+--------------------+