MariaDB (MySQL)Table doesn’t exist in engine error appears

  在自己的電腦架了個Joomla網站,之後準備移到正式環境,在將各項目一個一個複製過去後,卻遇到問題無法開啟網站的問題,抽絲剝繭後,Narrowed down to a database issue,When using MySQL before,Simply copying the files under the data directory,Was enough to complete the migration,This time it doesn't work that way,You must use other database tools to export and then import to make it work。I've seen articles about this before,It's best to back up and restore data using export/import,Don't use copy and paste,Finally encountered a problem,So I wanted to understand the reason,After repeated testing and searching online,Finally found the root cause。

  出現這種情形倒也不是MariaDB的關係而是InnoDB這個資料庫引擎以往舊的MySQL主要採MyISAM引擎資料庫檔案有.MYD(資料)與.MYI(索引)兩個型式此架構用複製貼上就不會有什麼問題而被新版MariaDB與MySQL採用的InnoDB引擎則是.frm與.ibd若要使用複製貼上的方式備份除了備份以上檔案外還需將data目錄底下的ibdata1也複製才能正確復原

【參考連結】

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.