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.

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.)


Edit

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 
                 --defaults-extra-file=/usr/local/zend/mysql/data/my.cnf 
                 --basedir=/usr/local/zend/mysql 
                 --datadir=/usr/local/zend/mysql/data 
                 --user=zend 
                 --log-error=/usr/local/zend/mysql/data/mycomputer.local.err 
                 --pid-file=/usr/local/zend/mysql/data/mycomputer.local.pid 
                 --socket=/usr/local/zend/mysql/tmp/mysql.sock --port=3306
share|improve this question

1 Answer 1

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 !!!

share|improve this answer
    
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 –  mmmshuddup 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? –  mmmshuddup Dec 17 '11 at 23:43
    
Sorry, while this was a good answer, it did not actually work and I still haven't solved this haha. Sorry it took me so long to upvote! –  mmmshuddup Nov 15 '12 at 3:10

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.