1

Consider the following situation.

I currently have an Ubuntu installation installed in my Virtual Machine. This installation has mysql installed in it.

Data for the mysql-server can be found under;

/var/lib/mysql

A default installation contains;

Folder "mysql"
Folder "performance_schema"
ibdata + ib_logfiles 
mysql_upgrade_info

Someone recently supplied me with a folder with this exact same structure, containing data. How can I succesfully implement the folder that I've received into the "clean installation"? Plain copying didnt work since it caused all kinds of permission issues. Is there any way to succesfully extract the data in the ibdata files, to my new mysql installation? The engine used is InnoDB. I'm just interested in viewing the actual content of this database. If there's any sort of viewer available to quickly have a "peek" in this structure, that would come in handy too.

1 Answer 1

1

Assuming that mysql versions are the same (or similar enough):

  1. Shut down mysql
  2. Remove contents of /var/lib/mysql and replace with the new data
  3. Correct permissions on the files (hint: use chown and chmod)
  4. Start mysql
2
  • For some reason, whenever I copy the data, MYSQL automatically assumes an other standard login name; debian-sys-maint.
    – MichaelP
    Jul 13, 2015 at 23:05
  • 1
    Yes, because they are also stored inside the database. You will need to start MySQL in special mode to re-create your users. dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
    – Marki555
    Jul 14, 2015 at 6:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .