I get the same results as you do using this:

karsites:/usr/local/mysql-5.0.18/bin # ./my_print_defaults mysqld
karsites:/usr/local/mysql-5.0.18/bin # ./my_print_defaults client
--socket=/var/lib/mysql/mysql.sock
--port=xxxx
karsites:/usr/local/mysql-5.0.18/bin #

It seems like the last parameter passed to my_print_defaults
tells my_print_defaults to get that particular section from 
the/etc/my.cnf file and print it out.

However, you can pass a parameter to my_print_defaults, to 
tell it which my.cnf file to check. So doing this:

karsites:/usr/local/mysql-5.0.18/bin # ./my_print_defaults 
--defaults-file=/usr/local/mysql-5.0.18/my.cnf mysqld
--basedir=/usr/local/mysql-5.0.18
--server-id=1
--skip-name-resolve
--skip-locking
--set-variable=key_buffer=16M
--set-variable=max_allowed_packet=1M
--set-variable=table_cache=64
--set-variable=sort_buffer=512K
--set-variable=net_buffer_length=8K
--set-variable=myisam_sort_buffer_size=8M
--log=5-0-18.log
--log-bin=laptop-bin
--log-error=5-0-18.error-log
--log-queries-not-using-indexes
--log-slow-admin-statements
--log-slow-queries=5-0-18.slow-log
--log-warnings
karsites:/usr/local/mysql-5.0.18/bin #

Does actually return the correct my.cnf file details.
You can also use the -c /usr/local... shorthand option to 
tell my_print_defaults which my.cnf to look at.

'my_print_defaults --help' will return all the available 
options you can use. This is actually a Linux ELF file, and 
not a shell script Alex.

That's something I have also just learned, so I'm pleased 
you mentioned it, because I was having the same problem, 
until I checked the options available, using --help.

Are there any other problems you have encountered using this 
type of my.cnf setup?

Keith

In theory, theory and practice are the same;
In practice they are not. 

On Mon, 13 Mar 2006, Alex Moore wrote:

> To: mysql@lists.mysql.com
> From: Alex Moore <[EMAIL PROTECTED]>
> Subject: Re: mysql5 options file location
> 
> On Mon, 13 Mar 2006 23:05:30 +0000 (GMT)
> [EMAIL PROTECTED] wrote:
> 
> > Exactly what are the problems you are having with the server 
> > specific my.cnf file?
> 
> Sorry, I thought that I had described the problem.  A quick example was
> 'my_print_defaults mysqld' returning only the options defined in the
> global file.  None of the options from the server-specific my.cnf are
> returned.  This is not the way 4.1, and probably earlier, works.
> 
> Thanks,
> 
> Alex

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to