3

I copy my database files from windows

wamp/bin/mysql/mysql5.6.17/data

into my ubuntu

/var/lib/mysql/

Folders of my database_name and ibdata1, ib_logfile0, ib_logfile1 files. Now my all databases and tables are visible into phpmyadmin but when selecting any table, it shows table doesn't exist

How to get back my all the data

Here is the screenshot.

sirajalam049
  • 181
  • 2
  • 9
  • First I would check if the file system permissions in /var/lib/mysql/ are correct for the mysql system user to access your data – HBruijn Feb 22 '17 at 11:14
  • I have run this command. `$ sudo chown -R mysql:mysql /var/lib/mysql/` – sirajalam049 Feb 22 '17 at 11:15
  • Have you considered dumping the database using mysql tooling, rather than copying the folder structure? It sounds like you may not have all the files needed, are there any errors (other than "table doesn't exist") in your mysql logs? Also, a silly question, but did you restart mysql after copying and chown'ing the files? – iwaseatenbyagrue Mar 06 '17 at 08:44

2 Answers2

3

After Googling a lot I found the answer.

Restart your mysql

sudo mysql stop

sudo mysql start

Refresh the phpmyadmin page

sirajalam049
  • 181
  • 2
  • 9
  • 1
    Thank you for posting this question and answer. Very illogic that restarting an sql server solves the problem of a table missing in a database import. – Matt Welander Oct 15 '20 at 07:58
0

I have solved the problem in ubuntu 18.2 using >> sudo chown -R mysql:mysql var/mysql/