Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Getting my hands dirty with a MySql slave setup, I ran into a puzzling question: how do I pass any of the myriad options to mysqld (--skip-slave-start in this particular case) when I am restarting it and it is installed as an Upstart job?

I can think of many ways to hack it, but I feel I must be missing something obvious.

TIA,

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Consider specifying skip-slave-start in the cnf instead. Typically, flags are specified in the init script, which would be located in /etc/init.d.

share|improve this answer
    
I agree with Warner. Set the options in the config file. If you do want to pass options to mysqld in the init script the file you need is actually /etc/init/mysql.conf and the options get added to line 27 on a standard 10.04 install. You can start mysqld from the command line without using init at all but it is not a good solution for production use. –  Richard Holloway Aug 5 '10 at 22:36
    
Right, both editing the cnf and starting it on the command line were in fact my "hack it" solutions. I probably should have been more specific - the option I want to pass to mysqld is not permanent, it's only a one-time option. Mysqld is already running, I just need to temporarily restart it with this option while I perform some administration (setup as a slave), after that I'd restart it again in production mode, i.e. without the option. Again it's not a blocker or anything, I'm just puzzled about the lack of this feature. –  Jare Aug 6 '10 at 7:25
    
Why would you restart when you can just stop slave;? skip-slave-start is to prevent it upon startup. –  Warner Aug 6 '10 at 13:09
    
Warner, that is correct. I was getting some errors after doing this via stop slave; and I thought they were caused by the threads having started then stopped, so I went off this tangent, but the same errors still happen. Thanks! –  Jare Aug 9 '10 at 11:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.