GingerRobot Posted November 1, 2008 Share Posted November 1, 2008 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 More sharing options...
corbin Posted November 1, 2008 Share Posted November 1, 2008 Uh, I don't think it's possible to have 2 mysql instances reading from the same data files. Seems like there would be locking/concurrency issues. Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-680198 Share on other sites More sharing options...
GingerRobot Posted November 2, 2008 Author Share Posted November 2, 2008 Hmm - perhaps you're right. Not knowing an awful lot about it, i kinda assumed there wouldn't be any concurrency issues since the data would be being read by two instances at the same time. Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-680573 Share on other sites More sharing options...
corbin Posted November 2, 2008 Share Posted November 2, 2008 Well, like what if you issued a query to one of the servers, and the other didn't notice it for a while... Also, I would assume the instances lock the files that they open until the MySQL instance dies. Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-680612 Share on other sites More sharing options...
GingerRobot Posted November 2, 2008 Author Share Posted November 2, 2008 That's my point though - this is with a dual-boot setup (perhaps that wasn't clear?), so it's not possible for both mysql servers to be running. Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-680642 Share on other sites More sharing options...
corbin Posted November 2, 2008 Share Posted November 2, 2008 Oh uhhhh.... No idea then. Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-680767 Share on other sites More sharing options...
fenway Posted November 3, 2008 Share Posted November 3, 2008 What does the error log say? Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-681456 Share on other sites More sharing options...
GingerRobot Posted November 3, 2008 Author Share Posted November 3, 2008 I get this appearing in mysql.log: /usr/sbin/mysqld, Version: 5.0.51a-3ubuntu5.1-log ((Ubuntu)). started with: Tcp port: 3306 Unix socket: /var/run/mysqld/mysqld.sock Time Id Command Argument Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-681475 Share on other sites More sharing options...
corbin Posted November 4, 2008 Share Posted November 4, 2008 Errrr.... That would be it successfully starting. There isn't any error looking stuff around that? Or perhaps in a different log file? Do you have a debug binary? If so, try running that one, and maybe it will give more output. Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-681732 Share on other sites More sharing options...
GingerRobot Posted November 9, 2008 Author Share Posted November 9, 2008 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. Link to comment https://forums.phpfreaks.com/topic/130997-solved-changing-datadir/#findComment-685926 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.