How do I start mysqld with options

3

I need to start up mysqld with command line options as from here:

http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_skip-grant-tables

I normally do sudo service mysqld start, but passing the option as sudo service mysqld start --skip-grant-tables does not seem to work.

Alternatively I have tried starting as a daemon,

sudo mysqld_safe --skip-grant-tables &

But it seems to terminate too soon:

131101 04:59:57 mysqld_safe Logging to '/var/lib/mysql/vagrant.example.com.err'.

131101 04:59:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

131101 05:00:03 mysqld_safe mysqld from pid file /var/lib/mysql/vagrant.example.com.pid ended

My last option seems to specify the option in /etc/my.cnf instead, but is there any way to do it via the command line?

xiankai

Posted 2013-11-01T05:01:50.977

Reputation: 478

which version of centos are you using? – Back2Basics – 2013-11-01T06:19:15.427

I'm using CentOS 6.4 – xiankai – 2013-11-01T08:53:16.323

I think the file is located here: /etc/init.d/mysqld edit this to have the commandline parameters you want then do the "sudo service mysqld start" – Back2Basics – 2013-11-01T15:49:50.627

Answers

2

Your command seems fine.

You should check /var/lib/mysql/vagrant.example.com.err log file to see why it's failing.

seqizz

Posted 2013-11-01T05:01:50.977

Reputation: 81

It turns out that the error was entirely due to something I failed to mention - 131101 4:59:58 [ERROR] /usr/libexec/mysqld: unknown option '--skipnetworking', but the error log helped me catch that, so I'm accepting this as the answer. – xiankai – 2013-11-01T11:13:24.630