Schrödingers MySQL table: exists, yet it does not

后端 未结 11 1865
野趣味
野趣味 2020-11-29 23:47

I am having the weirdest error of all.

Sometimes, when creating or altering tables, I get the \'table already exists\' error. However, DROP TABLE returns \'#1051 - u

11条回答
  •  爱一瞬间的悲伤
    2020-11-30 00:19

    If will are stock with this error 1051 and you only want to delete the database and import this again do this steps and all gonna be just fine....

    in Unix envoriment AS root:

    • rm -rf /var/lib/mysql/YOUR_DATABASE;
    • OPTIONAL -> mysql_upgrade --force
    • mysqlcheck -uUSER -pPASS YOUR_DATABASE
    • mysqladmin -uUSER -pPASS drop YOUR_DATABASE
    • mysqladmin -uUSER -pPASS create YOUR_DATABASE
    • mysql -uUSER -pPASS YOUR_DATABASE < IMPORT_FILE

    Regards, Christus

提交回复
热议问题