I have an intact file system with a nonworkable old installation of linux. All the mysql pieces are there fine, I can see all the data files, but I can't figure out how to access them. I've tried a whole bunch of different approaches. Most recently I tried adapting this https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-16-04

That tutorial helps migrate a database over from the default to a mounted partition. I'm trying to do the reverse, so I reinstalled mysql fresh and tried.

Unfortunately the tables just don't show up when I log in as root. I know a user "pyuser" was the creator of the dbs (and I have the password) but logging in doesn't work... should it show up if I log in under root anyway? can worry about the user problem later if I can just get access to the data.

Essentially my /var/lib/mysql/ folder now is a copy of the old folder exactly (did it with rsync)

How do I access these tables within the new os? I'm using linux mint, freshly installed onto a new drive

  • Check the "Related" questions on the right to see what people usually do when they move the MySQL data directory, then add to your question the exact commands you ran and their exact output (as text, not images). Right now there are exactly zero details in your question that can help people help you.
    – mustaccio
    Commented Sep 6, 2023 at 17:55
  • Start with --skip-grant-tables as a command line or config option (without leading --). Which mysql version are you starting with? What does the service logs say journalctl -u mysql.service -n 40 or if they are in a /var/log/mysql file, the copy of that log.
    – danblack
    Commented Sep 7, 2023 at 23:29

1 Answer 1


What version of MySQL created those datafiles? If it is too old and unavailable, there could be incompatibilities that will cause trouble. Otherwise, install the files on another machine that has a not-too-much-newer version of MySQL/MariaDB; then see if the data looks intact.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.