LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 05-23-2006, 11:56 AM   #1
whysyn
Member
 
Registered: Jun 2003
Location: Cleveburg, OH
Distribution: mostly Fedora
Posts: 154

Rep: Reputation: 30
mysql databases on separate drives - worked 3.23, busted 4.1


Hi All!

Let me see if I can describe this so it makes sense...

I have a rather large database server. I'm setting up its replacement, and have run into a snag. On the old server, I had a drive with the OS on it, and individual drives per database. For example, /boot, /home, /var, all on sda partitions, and then sdb1, sdc1, and sdd1 mounted as /var/lib/mysql/database1/, /var/lib/mysql/database2/, /var/lib/mysql/database3/. This was great because each database gets hit hard and this spread the load across physical disks for increased performance. This was a RedHat 8 server running mysql 3.23.

The new system is running Fedora Core4 (x86_64) and mysql 4.1, but has a similar hard drive setup. Unfortunately, mysql 4.1 does not seem to like having separate drives for each database. Does anybody know of any config issues, or will the newer mysql version simply not support this? If I go into mysql and do a show databases, i only see "test" and "mysql," even though the directories also exist for database1, 2 & 3 and permissions are set correctly.

Thank you!
 
Old 05-23-2006, 03:43 PM   #2
whysyn
Member
 
Registered: Jun 2003
Location: Cleveburg, OH
Distribution: mostly Fedora
Posts: 154

Original Poster
Rep: Reputation: 30
OK, reading the docs, they suggest making a symlink for the directory, and mention nothing at all about mounting. Let's give it a whirl. I also have one database set up like this on the old server, so I know it should work. But of course it doesn't.

Can anybody help me make this work?

Brief summary again:
Fedora Core4, mySQL 4.1.16, x86_64
3 x database drives (no raid, one DB per drive)
1 x OS drive

I remounted the database drives as:
Code:
[root ~]# mount /dev/sdb1 /mnt/database1/
[root ~]# mount /dev/sdb1 /mnt/database2/
[root ~]# mount /dev/sdb1 /mnt/database3/
Double checked permissions & ownership... good to go.

I then made the symlinks:
Code:
[root ~]# ln -s /mnt/database1 /var/lib/mysql
[root ~]# ln -s /mnt/database2 /var/lib/mysql
[root ~]# ln -s /mnt/database3 /var/lib/mysql
And log into mysql:
Code:
mysql> show databases;
+----------+
| Database |
+----------+
| mysql    |
| test     |
+----------+
2 rows in set (0.01 sec)

Where are my databases?

Double checked the mysql directory:
Code:
[root ~]# cd ~mysql/
[root ~]# ls -l
total 20556
lrwxrwxrwx  1 root  root        12 May 23 16:39 database1 -> /mnt/database1
lrwxrwxrwx  1 root  root        12 May 23 16:39 database2 -> /mnt/database2
lrwxrwxrwx  1 root  root        12 May 23 16:39 database3 -> /mnt/database3
-rw-rw----  1 mysql mysql 10485760 May 23 16:38 ibdata1
-rw-rw----  1 mysql mysql  5242880 May 23 16:38 ib_logfile0
-rw-rw----  1 mysql mysql  5242880 Feb 22 13:36 ib_logfile1
drwxrwxr-x  2 mysql mysql     4096 May 23 11:39 mysql
srwxrwxrwx  1 mysql mysql        0 May 23 16:35 mysql.sock
drwxrwxr-x  2 mysql mysql     4096 Feb 22 13:36 test
ARGH!
 
Old 05-24-2006, 03:25 PM   #3
whysyn
Member
 
Registered: Jun 2003
Location: Cleveburg, OH
Distribution: mostly Fedora
Posts: 154

Original Poster
Rep: Reputation: 30
It seems this is a "problem" with SELinux.

I changed SELinux to "permissive" instead of "enforced" and mysql is now able to access databases on separately mounted drives.

Hopefully I'll be able to pull info out of the audit logs and reconfigure SELinux so I can have it in enforcement mode but still have mysql work properly...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Separate drives to install XP and Linux wxman2 SUSE / openSUSE 5 08-29-2005 02:45 PM
Assigning MySQL databases to certain hard drives benrose111488 Linux - Software 5 11-23-2004 11:42 AM
restoring mysql databases? and mysql permissions... armegeden Linux - Software 0 03-13-2003 11:04 AM
mysql databases k3v0 Linux - Software 2 12-03-2002 07:41 PM
how-to for using lilo to boot two separate drives jackopa Linux - General 4 04-19-2002 02:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration