MySQL database filestorage location (how to change?)
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
MySQL database filestorage location (how to change?)
Hi.
I have several databases on my MySQL server, some of them are getting pretty large and I want to start storing them in separate locations. I have found that you can edit the config files to change where ALL of the database files are stored and then just move the database files to the new location, however, I want to store the databases in different places, some on different drives/partitions etc, is there a way of specifying the file location on a per database basis?
Not sure if it's possible by configuration per database, but symlinking works. You can symlink both directories (databases) or files (tables). This is often used to spead up things - I think people usually move to have index files on data on different disks.
Ok, so if I get some more disks / one nice big disk to store the MySQL database/tables on what disk format would be best for the partition?
The database in question is quite large, it has lots of writes but these are mainly delayed inserts and no one is going to shed any tears if they take a little while to happen. It would be good if reads could be as fast as possible, the cache hit rate isn't terribly high due to the randomness of the requests.
Nothing is wrong with the MySQL setup as such, I was just wondering if there was any way of improving the speed by using an efficient filesystem format. I use ext3 on all the other drives and the MySQL (/var/wherever it is), at the moment. Would ext3 be ok for a dedicated MySQL partition or would something simpler improve performance?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.