I am trying to set some defaults in my.cnf and when I tried to check MySQL's current defaults I got an error!

  • Using Zend Server CE 5.5
  • on OSX 10.6.8

And here is the command and subsequent error:

$ mysql --print-defaults
/usr/local/zend/mysql/bin/mysql.client: unknown option '--print-defaults'

When I type --help it shows the --print-defaults as an option.

Am I doing something wrong? Has anyone else experienced this?

(Note: if this question belongs on Super User please let me know and don't downvote it -- unless it actually deserves one.)


I tried doing mysqld --print-defaults and as I reported it didn't work either. So I checked if it was running and this is what I got:

$ ps aux | grep mysqld
 5:36PM  0:00.01 grep mysqld
Mon02AM  2:24.61 /usr/local/zend/mysql/bin/mysqld 
                 --socket=/usr/local/zend/mysql/tmp/mysql.sock --port=3306

mysql is the client program.

What you want is the server. Run this please

mysqld --print-defaults

I found it by asking the server

mysqld --help --verbose | grep print

and I got this

--print-defaults        Print the program argument list and exit.

A safer method is to use mysqladmin

mysqladmin -uuser -ppassword variables

Give it a Try !!!

  • I tried the first one and got this: $ mysqld --print-defaults (new-line) mysqld would have been started with the following arguments: and an empty argument list – Yes Barry Dec 16 '11 at 19:39
  • Make sure mysqld is running when you call mysqld --print-defaults – RolandoMySQLDBA Dec 16 '11 at 21:46
  • check my edit, mysqld is running and it still doesn't work.. Any ideas? – Yes Barry Dec 17 '11 at 23:43
  • Many years later...You were right though it never worked for Zend Server because Zend Server sucks and especially back then. I had stopped using it years ago and just recently ran across this old Q. Solution: never use zend server. brew install httpd ftw. Even MAMP is better. Code tracing was the only worthwhile feature of ZS and it was buggy anyway. – Yes Barry Mar 7 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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