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
Solved

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

Posted on 2009-07-10
1
1,062 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…

840 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