[ACCEPTED]-MySQL, copying tables files gives rise to "ERROR 1017 (HY000): Can't find file:" even though its there there-mysql

Accepted answer
Score: 35

I'd suggest giving two things a try:

1. Check Permissions

Make 9 sure that your MySQL data directory and 8 all the files in it are owned by mysql user 7 and mysql group. This may not be the case 6 if you copied the files onto your local 5 test machine as root user:

chown -R mysql:mysql your-mysql-data-dir-here

2. Repair corrupted tables

Use mysqlcheck to check 4 for corrupted tables and repair them if 3 it finds any:

mysqlcheck -u root -p --auto-repair --all-databases

If you still can't use the 2 tables after that then give mysqldump a 1 go!

Score: 3

I encountered the same issue after restoring 7 a MySQL database with frm and MYD files. After 6 a number of hours spent I observed that 5 I have configured the database directory 4 with only read and write permission to mysql 3 user but not execute permission. After adding 2 execute permission to the database directory, the 1 problem was solved.

Score: 0

I did have the very same issue a couple 9 minutes ago and it took me a few minutes 8 to realize that I had insufficient permission 7 to access the .sql file I wanted to import.

In 6 order to get rid of this problem you could 5 just move the file to a place you know you 4 have access to (with your current user) for 3 sure. (eg. ~/Home_directory).

I hope I could 2 help some lonely soul that was searching 1 for the answer just like I was.

Score: 0

I had the same issue and did this...

  • Delete Migrations Folder
  • Drop the _migrationhistory table
  • Enable, Add and Update migration

I'm 2 sure there's a much better way to solve 1 this but, it worked for me.

Score: 0

I changed permissions for the mysql-data-directory 2 as well as the <table>.frm file.
If using as root user:

  • chmod 600 mysql-data-directory chmod 600
  • mysql-data-directory/tableOfData.frm

If 1 using as non-root user:

  • chmod 660 mysql-data-directory
  • chmod 660 mysql-data-directory/tableOfData.frm
Score: 0

This error, "General error: 1017 Can't find 2 file", also happened on Windows with WAMP 1 if the table doesn't exist.

Score: 0

Try following things:

  • repair whole database
  • change permission to mysql:mysql
  • restart mysql service

One of these will work.

0

More Related questions