At 11:23 -0600 12/15/04, Randy Paries wrote:
So I tried
$bindir/mysqld_safe --defaults-file=/etc/my.cnf --datadir=$datadir
--defaults-file=/etc/my.cnf --pid-file=$pid_file &> /dev/null &

I get the error::
041215 11:15:11  mysqld started
/usr/sbin/mysqld: ERROR: unknown variable 'defaults-file=/etc/my.cnf'
041215 11:15:11  mysqld ended

mysqld does accept the --defaults-file, but I am trying to get this to run
properly from the init.d startup

It appears that mysqld_safe does not accept --defaults-file

I guess I could hack the mysqld_safe, but I would really like to do it the
correct way...

thanks

What did mysqld --help report for the set of option files that mysqld will read?



-----Original Message----- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 15, 2004 11:08 AM To: Randy Paries; [EMAIL PROTECTED] Subject: Re: Help getting mysqld to read my my.cnf on start from init.d on mandrake 10.1 and mysql 4

At 11:02 -0600 12/15/04, Randy Paries wrote:
Hello,

I am building a new DB box.
The box is mandrake 10.1 and mysql 4.0.20

All my other boxes are RH9 and mysql 3

The one problem I am having is they appear to do the my.cnf differently

There was no my.cnf in the /etc dir, so I created one from my-huge.cnf
and placed it in the /etc

But the startup does not use it.

Run "mysqld --help" and look at the help message to see what option files the server thinks it's supposed to read. One possibility is that it reads /etc/mysql/my.cnf instead of /etc/my.cnf -- I believe some vendors hack MySQL to change the location of the global option file.


So I tried to append the same command to the mysql script that is called from init.d --defaults-file=/etc/my.cnf and I get the error 041215 10:51:59 mysqld started /usr/sbin/mysqld: ERROR: unknown variable 'defaults-file=/etc/my.cnf' 041215 10:51:59 mysqld ended

The probable cause of this is that --defaults-file is not the first option.


That part that confuses me is in the script /etc/rc.d/init.d/mysqld (I put in some debug echos to see where it is exiting) When I run the startup it print "2"

But I am not failure with /usr/bin/my_print_defaults

Thanks for any help!

Randy
==============================SNIP===================================
# Get arguments from the my.cnf file,
# groups [mysqld] [mysql_server] and [mysql.server] if test -x
./bin/my_print_defaults then
         echo "1"
   print_defaults="./bin/my_print_defaults"
elif test -x $bindir/my_print_defaults
then
         echo "2"
         print_defaults="$bindir/my_print_defaults"
elif test -x $bindir/mysql_print_defaults then
         echo "3"
   print_defaults="$bindir/mysql_print_defaults"
else
         echo "I am here"
   # Try to find basedir in /etc/my.cnf
   conf=/etc/my.cnf
   print_defaults=
   if test -r $conf
   then
     subpat='^[^=]*basedir[^=]*=\(.*\)$'
     dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
     for d in $dirs
     do
       d=`echo $d | sed -e 's/[  ]//g'`
       if test -x "$d/bin/my_print_defaults"
       then
         print_defaults="$d/bin/my_print_defaults"
         break
       fi
       if test -x "$d/bin/mysql_print_defaults"
       then
         print_defaults="$d/bin/mysql_print_defaults"
         break
       fi
     done
   fi

   # Hope it's in the PATH ... but I doubt it
   test -z "$print_defaults" && print_defaults="my_print_defaults"
Fi
>==============================SNIP===================================

-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com

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



Reply via email to