NotionCommotion Posted January 10, 2015 Share Posted January 10, 2015 My my.cnf file has three sections (mysqld, mysqld_safe, mysql). It seems that they represent different modes which MySQL runs in. Is this correct? I read that some recommend running in safe mode. Should I be if it is being used to support PHP? I typically start MySQL as "service mysqld start" when running Centos. How should I be starting it if I want it in safe mode. Quote Link to comment https://forums.phpfreaks.com/topic/293820-what-mode-should-mysql-be-running-in-when-used-with-php/ Share on other sites More sharing options...
kicken Posted January 11, 2015 Share Posted January 11, 2015 They are not really modes. The options in the configuration file are divide into various groups. Each of mysql's programs has a set of groups it will look at for options. mysqld is the actual executable for the mysql server. [mysqld] is it's unique group. mysqld_safe is a wrapper script that adds a little bit of extra safety by restarting the server if it crashes and some error logging. It will look at the [mysqld_safe] group for it's options. mysql refers to the mysql client application, not the server. It will look for options in the [mysql] group. If you installed mysql using your system's package manager, it's probably already setup the service to start using whatever method is appropriate. I wouldn't worry about ensuring it uses mysqld_safe vs mysqld. All you need to look into is configuring mysql's options (ie memory limits, connections, etc.) so that it runs well for your environment 1 Quote Link to comment https://forums.phpfreaks.com/topic/293820-what-mode-should-mysql-be-running-in-when-used-with-php/#findComment-1502584 Share on other sites More sharing options...
NotionCommotion Posted January 11, 2015 Author Share Posted January 11, 2015 Thanks Kicken, I haven't been able to find any documentation explaining the "big picture" behinds the my.cnf file. Yes, there is documentation about the individual settings, but I haven't seen anything describing these "groups and options". Could you point me in a good direction to read up on them? Thank you Quote Link to comment https://forums.phpfreaks.com/topic/293820-what-mode-should-mysql-be-running-in-when-used-with-php/#findComment-1502594 Share on other sites More sharing options...
QuickOldCar Posted January 12, 2015 Share Posted January 12, 2015 Try mysqltuner out, is a perl script for optimizing. Make sure you make a backup of your original file. Quote Link to comment https://forums.phpfreaks.com/topic/293820-what-mode-should-mysql-be-running-in-when-used-with-php/#findComment-1502687 Share on other sites More sharing options...
NotionCommotion Posted January 12, 2015 Author Share Posted January 12, 2015 Thanks QuickOldCar, Wasn't really looking to optimize my.cnf, but just better understand how it is organized. I would have expected http://dev.mysql.com/doc/refman/5.5/en/option-files.html to describe it, but it doesn't really do so. Quote Link to comment https://forums.phpfreaks.com/topic/293820-what-mode-should-mysql-be-running-in-when-used-with-php/#findComment-1502716 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.