Jump to content

Recommended Posts

I'm trying to change my datadir on ubuntu so that i'm working with the same database if im in windows or ubuntu. I assume this is just a case of changing the datadir to the same folder (i'm using fs-driver to provide access to my home folder, which is a separate partition, in windows) in both windows and ubuntu.

 

I changed the datadir in windows first and moved the files with no problem. However, i can't get this to work in ubuntu. I changed the datadir in my /etc/mysql/my.cnf file to "/home/ben/MySQL/data" and also changed the owner of the folder : "sudo chown -R mysql:mysql ./MySQL/data". I've tried a fair few variations, without success.

 

Whenever i try to start the mysql server again, it fails. No error - not sure if there should be. I'm very inexperienced with this kind of thing, so i'm probably missing something simple. Any ideas anyone?

 

Edit: I also noticed in the my.cnf file, it metions altering /etc/apparmor.d/usr.sbin.mysqld. I've no idea what this really is, but I did try modifying the lines that referenced the original data dir without success.

Link to comment
https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/
Share on other sites

Ok, so i finally got somewhere with this. Turns out it was to do with apparmor. Though i'd tried changing the config file, I forgot/didn't realise I needed to restart the service too. Got some other issues now - perhaps it isn't going to be so easy to get this working. But never mind, i'm getting somewhere i think. I'll mark this solved.

 

Cheers for the help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.