MySQL 導出數據庫,出現 “mysqldump: Got error: 1146”


出現場景

在 cmd 導出數據庫時:

mysqldump -hlocalhost -uroot -p student_db > C:\student_db.sql

出現:

mysqldump: Got error: 1146: Table 'student_db.student' doesn't exist when using LOCK TABLES

解決過程

網上說鎖定所有表即可解決,即:--lock-all-tables,-x
mysqldump -hlocalhost -uroot -p -x student_db > C:\student_db.sql
然而我的情況並沒有解決。

查看出現問題的數據表:

use student_db;
show tables;
-- student 存在

select * from student;
show create table student;
-- 上面兩個都提示:ERROR 1146 (42S02): Table 'student_db.student' doesn't exist

結論

重啟 MySQL,再次進入時 OK。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM