4

I used to use mysql data in /var/lib/mysql, now I have created new partition and created tank on it to use with zfs.

After that I follow this steps to move my existing mysql data to new dir: https://serverfault.com/a/539729/184573

Everything worked ok so I have imported new big db (100 GB) and now is not working anymore.

I'm getting this error enter image description here

in "/var/log/mysql/error.log"

Detailed explanation:

  1. I'm on /tank/mysql, using zfs and everything is working ok

  2. imported new db, mysql was working ok

  3. stopped mysql service and executed zfs

  4. snapshot tank/mysql@imported now I cannot start mysql because of upper error

  5. tried to chown mysql:mysql /tank/mysql -R , still same error

I have google that problem and none of solutions helped me. Permissions, settings,... everything seems to be ok.

OS: Ubuntu server 14.04.

Server: IBM X3200 m3

What could be a problem?

Thank you

  • 1
    Looks surely like a file permission related issue. Can u pls post ls -l output from inside the mysql datadir? – ksm Jul 8 '16 at 16:28
  • @ksm - permissions are same as in /var/lib/mysql. When I switch back to /var/lib/mysql it is working ok – iWizard Jul 8 '16 at 16:31
  • @ksm - if you need any more info please let me know – iWizard Jul 8 '16 at 16:32
  • 1
    How did u copy the files to the new dir? What user were u logged in as? Did u run 'chown -R mysql:mysql *" to the mysql directory after copy completed? – ksm Jul 8 '16 at 16:33
  • @ksm - yes I did. With old data was working so I have imported new db when I was already using /tank/mysql and zfs – iWizard Jul 8 '16 at 16:35
4

Posting this as an answer.

It was a file permissions issue. U need to ensure that the mysql user has access to the mysql datadir and the directory it is in, all the way to the root level directory.

If multiple users need access to these directories, then put them in a group and then give that group access to those directories.

| improve this answer | |
4

Why don't you just put the ZFS dataset in the location MySQL expects?

zfs set mountpoint=/var/lib/mysql tank/mysql

Now you don't have to worry about strange permissions on /tank and everything looks normal to the rest of the system.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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