I am trying to import a large database but because there’s an index, it is taking forever to import the database. I tried copying the raw files to a different machine but for some reason, the largest table is not being read giving me an error: can't read file: 'tablename.MYD. So I mysqldumped my old database but it did so with an index. I cannot do it again because it takes a really long time.
I am trying to import the database but am not sure how to do it without indexes. I thought adding an index after import will be much faster. Does anyone have any suggestions?
To disable the indexes and import from a dump file:
alter table tablename disable keysAnd then when the import is done:
alter table tablename enable keysAlthough copying the file in the manner you mentioned should work. You just have a permission error. On the shell do:
chown mysql.mysql tablename.*and then restart your database. (make sure you are in the folder the table exists at when you use that command) That should fix the issue.Edit: clarified where you should use the command