Solved

What is the difference between starting mysql via chkconfig and mysqld_safe?

Posted on 2009-07-10
1
1,081 Views
Last Modified: 2012-05-07
Hi,

I am noticing mysqld spontaneously stopping after a few minutes without logging any errors when i start it via $ service mysqld start. When I start it via $ mysqld_safe --user=mysql it seems to run fine. I noticed in /etc/init.d/mysql that this:

get_mysql_option mysqld datadir "/var/lib/mysql"

This is not the location of my datadir. Is this the problem? Do I need to customize the init script? Why isn't this init script using my values from /etc/my.cnf?

Thanks
0
Comment
Question by:tomp_gl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 24832502
mysqld_safe AFAIK is the recommended way to start MySQL instance on Netware and according to manual it is so for Linux: http://dev.mysql.com/doc/refman/5.1/en/mysqld-safe.html.

However, you are starting mysql should read the my.cnf file; however, any options specified as arguments to the start command will override what is the in the cnf file.  Therefore, the datadir "/var/lib/mysql" is overriding the correct value that is in your my.cnf.

Try changing to this:
get_mysql_option mysqld

And see if you have the same issues.  That is most likely the issue if that directory is invalid.  The fact that you are not starting with mysqld_safe is why you are not getting log of error causing the shutdown.  Moreover, if you note in your $ mysqld_safe --user=mysql method of starting datadir is not specified.  If you tried $ mysqld_safe --user=mysql --datadir="/var/lib/mysql" you may get the same symptom.

Regards,
Kevin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question