Solved

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

Posted on 2009-07-10
1
1,038 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now