LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (http://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   I have RHEL 5.0 and MySQL start problem, my MySQL server doesn't start (http://www.linuxquestions.org/questions/linux-enterprise-47/i-have-rhel-5-0-and-mysql-start-problem-my-mysql-server-doesnt-start-700553/)

rsatya 01-28-2009 12:03 PM

I have RHEL 5.0 and MySQL start problem, my MySQL server doesn't start
 
My MySQL server in RHEL5.0 is running only when I gave chmod 777 my.cnf.

my data dir = /var/lib/mysql owner root, group root.
my.cnf owner root, group root.

where I have to change/configure ?

custangro 01-28-2009 02:13 PM

Quote:

Originally Posted by rsatya (Post 3424223)
My MySQL server in RHEL5.0 is running only when I gave chmod 777 my.cnf.

my data dir = /var/lib/mysql owner root, group root.
my.cnf owner root, group root.

where I have to change/configure ?

You need to give the mysql user access to that directory....

first find out what user mysql runs as (usually mysql...you can find out in the /etc/init.d/mysql file).

Then
Code:

root@host# chmod 770 /var/lib/mysql
root@host# chown mysql:mysql /var/lib/mysql

-C

rsatya 02-02-2009 04:22 AM

custangro:

I have as you specified for the user. Now my /var/lib/mysql own:group are mysql mysql and chmod are 770.

my my.cnf is root:root , even though it didn't started. Still I need to give 777 to /etc/my.cnf.

then when I start using command

service mysql start it gives this message

warning:World-writable config file '/etc/my.cnf' is ignored
Starting MySQL [ok]

custangro 02-02-2009 10:28 AM

Quote:

Originally Posted by rsatya (Post 3428887)
custangro:

I have as you specified for the user. Now my /var/lib/mysql own:group are mysql mysql and chmod are 770.

my my.cnf is root:root , even though it didn't started. Still I need to give 777 to /etc/my.cnf.

then when I start using command

service mysql start it gives this message

warning:World-writable config file '/etc/my.cnf' is ignored
Starting MySQL [ok]

Try this...
Code:

root@host# chmod -R 770 /var/lib/mysql
root@host# chown -R mysql:mysql /var/lib/mysql
root@host# service mysql stop
root@host# service mysql start

-C

jonesr 02-03-2009 12:04 PM

Quote:

Originally Posted by rsatya (Post 3428887)
warning:World-writable config file '/etc/my.cnf' is ignored
Starting MySQL [ok]

For security, MySQL wants the configuration file owned by the user that will be running the code and not writable by other users.

First, grep chown /etc/init.d/mysqld to see what the system expects, then use that same form of chown on /etc/my.cnf.

Second, chmod 644 /etc/my.cnf so the file is readable by anyone but only writable by the user that will be running the daemon.


All times are GMT -5. The time now is 06:39 PM.