Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
11-22-2004, 07:55 PM
|
#1
|
Member
Registered: Jun 2004
Location: Wantage, NJ
Distribution: Fedora 7
Posts: 177
Rep:
|
Assigning MySQL databases to certain hard drives
Hey-
I've begun the ardueous trek of starting up my own website, which will be a community like this with the emphasis based mostly on a forum, but will also include blogging software, webmail, and a 'sermons' directory that my friend and I will post to as moderators of this site.
Anyway, as one could imagine, this new site will be an absolute resource CHUGGER. My webspace will be my brother's server, who will host me only because I am providing my own hard drive.
This hard drive will be mounted in /home/freespeak and will be hdb
Anyway, the question.
How does one make an SQL database be stored on ONLY that hdb, as to not interfere with the rest of his server's daily tasks? What is the command in the MySQL shell? Is it even possible?
Any feedback is greatly appreciated. Thanks in advance!
Last edited by benrose111488; 11-22-2004 at 07:57 PM.
|
|
|
11-22-2004, 08:46 PM
|
#2
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
Well, I've never done it, but according to this article , since MySQL stores each database in its own directory, you can set up a symlink pointing to another location. You'll just have to make sure that the symlink has the exact same name as the database.
|
|
|
11-22-2004, 10:09 PM
|
#3
|
Member
Registered: Jun 2004
Location: Wantage, NJ
Distribution: Fedora 7
Posts: 177
Original Poster
Rep:
|
Whoaaaaaa
I'm CERTAINLY not a newbie to MySQL, but those technical docs just go straight over my head.
And the colorful diagrams never help. :-/
Sorry, but could someone rationalize and simplify it for me? I don't kin well to big words and fancy diagrams.
Thanks again, Hangdog
|
|
|
11-23-2004, 08:18 AM
|
#4
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
OK, this is how I understand it.......
The MySQL admin (your brother?) would create the necessary databases and give you appropriate permissions. That would create a database directory in the normal MySQL data directory. Now on your new hard drive, you want to create a directory where you really want MySQL to store the data. Once that is done, move the files MySQL created from the MySQL database directory to the new hard drive directory. Finally, replace the MySQL database directory for this database with a link like this:
ln -s /path/to/new/directory databasename
In theory, that should "fool" MySQL into thinking that it is writing to a normal database directory, but in fact is writing to your new hard drive.
As I said, I've never done this, but looking at how MySQL works, I see no reason why this shouldn't do the trick.
|
|
|
11-23-2004, 12:23 PM
|
#5
|
Member
Registered: Jun 2004
Location: Wantage, NJ
Distribution: Fedora 7
Posts: 177
Original Poster
Rep:
|
ahhh makes perfect sense... thank you very much
In theory, you're right, it should work. Symbollic links rock
Any idea where the SQL satabases are stored by default?
|
|
|
11-23-2004, 12:42 PM
|
#6
|
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
|
You may have to dig into your my.cnf file to make sure, but at least with the standard Slackware package, the databases are in /var/lib/mysql
|
|
|
All times are GMT -5. The time now is 12:39 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|