LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-22-2010, 05:53 AM   #1
elflesnoy
LQ Newbie
 
Registered: Dec 2010
Posts: 1

Rep: Reputation: 0
MySQL with alternative datadir


Hello!

After several hours of searching web I give up.
Problem: I want to run mysqld with datadir option

When I run it manually without --datadir everything is fine

I have added required lines to /etc/apparmor.d/usr.sbin.mysqld and restarted apparmor
Quote:
/sys/devices/system/cpu/ r,
/disk0/mysql r,
/disk0/mysql/** rwk,
Then I copy /var/lib/mysql to my location, carefully, 10 times checking all the permissions and run. But daemon exits immediately after running.

Quote:
sudo mysqld_safe --datadir=/disk0/mysql --user=mysql
101222 11:29:46 mysqld_safe Logging to syslog.
101222 11:29:46 mysqld_safe Starting mysqld daemon with databases from /disk0/mysql
101222 11:29:47 mysqld_safe mysqld from pid file /disk0/mysql/d-st-n1.pid ended
I go to check syslog and see nothing
Quote:
Dec 22 11:29:46 d-st-n1 mysqld_safe: Starting mysqld daemon with databases from /disk0/mysql
Dec 22 11:29:47 d-st-n1 mysqld_safe: mysqld from pid file /disk0/mysql/d-st-n1.pid ended
Any ideas ?
 
Old 12-22-2010, 10:09 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
If you haven't already, please look in your Mysql log, too:
EXAMPLE: /var/log/mysqld.log

Also check the syntax in your my.cnf configuration file:
EXAMPLE: /etc/my.cnf
Code:
[mysqld]
datadir=/opt/mysqldata
...
This link might help:
http://docdb.fnal.gov/doc/my.cnf.html
 
Old 12-22-2010, 01:58 PM   #3
TheGorf
LQ Newbie
 
Registered: Feb 2009
Posts: 11

Rep: Reputation: 0
What distribution are you running? It's possible you are running into SELinux permissions issues. You can test that option easily by using the "getenforce" command:

Code:
[gorf@dlsrv01 logrotate.d]$ getenforce
Enforcing
That tells me that my local system is using SELinux and is enforcing. If that's true, then the simple test is to temorarily turn it off:

"setenforce Permissive"

Then try to restart your MySQL process.
 
  


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
[SOLVED] MySQL datadir from previous install mwjones Linux - Server 1 06-22-2010 08:55 AM
Trying to move datadir of mysql edudirectories Linux - Enterprise 1 02-14-2009 07:29 PM
Start MySQL with a non-default datadir nifflerX Linux - Enterprise 9 02-28-2006 05:42 AM
Trying to move datadir of mysql edudirectories Linux - Software 2 02-10-2006 06:25 AM
mySQL my.cnf (moving default datadir) not working! madfitz Linux - Newbie 4 02-09-2006 07:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:43 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