Solved

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

Posted on 2009-07-10
1
1,072 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
1 Comment
 
LVL 59

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 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