You are not logged in.
I want to shift my mysql default data directory from /var/lib/mysql to a folder in my home folder, because the databases I will be creating will be over 100Gb, and my root folder is on a 32 Gb SSD. Could anyone please give me proper detailed steps on how to accomplish this. I tried to do this once following some blog online and it messed up my whole mysql installation(I had to reinstall everything).
Offline
This is kinda temporary though. Say I follow your advice, do I just create a partition and then mount it in fstab? No permission changes etc ?
Offline
You have make sure permissions are initially set correctly, but then it will just be automatically mounted by fstab.one time setup, then you don't have to think about it anymore.
Offline
I'm not entirely sure how to go about it. There is a /var/lib/mysql directory. Also, I just noticed that mysqld.sock and mysqld.pid is in a different directory(/run/mysqld). How di I set the permissions correctly?
Offline
You must have searched really hard before asking here!
Have a look at datadir / socket / pid_file @ my.cnf
Offline
In my my.cnf file there is no datadir option the socket and pid options point to /run/mysqld. I'm a little confused because of this. There is a datadir option separately for InnoDB, but it is commented out. Also I am planning to use MyISAM.
Offline
Why would datadir be for innodb only? https://dev.mysql.com/doc/refman/5.0/en … ld_datadir
Offline
No before the datadir line there is a line that says Uncomment the following lines if you are using InnoDb. That is what confused me. Also, when I changed that option it doesn't have any effect. The data is still stored in /var/lib/mysql
Offline
I'm having the same issue. Any help would be greatly appreciated.
Offline
I hope this aint counting as necromancy.
I found this thread but I also found the solution, so if anyone stumble into the same issues.
Here the basics:
If you do not use the default location, just put into /etc/mysql/my.conf (or whereever your conf is):
datadir=/path/to/datadir
Otherwise, it will always default to /var/lib/mysql (maybe this will change)
Have a nice day,
lufti.
Offline
I hope this aint counting as necromancy.
I found this thread but I also found the solution, so if anyone stumble into the same issues.
Here the basics:
If you do not use the default location, just put into /etc/mysql/my.conf (or whereever your conf is):
datadir=/path/to/datadirOtherwise, it will always default to /var/lib/mysql (maybe this will change)
Have a nice day,
lufti.
I think he already tried that. I am in the same boat and am still having issues. Even after adding a "datadir" entry, mysqld is still trying to use /var/lib/mysql
Offline