> There are three my.cnf you should look for:
>
> 1) /etc/my.cnf = global options
> 2) <datadir>/my.cnf = server options, overriding global options
> 3) <home_directory>/.my.cnf = user specific options, overriding server
> options

Thanks for your reply! The information does make sense.
However, I searched the whole file system but found only /etc/my.cnf.

If I put a copy of my.cnf to <datadir> would that be any help? Any what
is <home_directory>? Sorry I am kind of newbie for in-depth knowledge
of MySQL.

I am curiouse that why mysql comes with 3 copies of same (?)
configuration file. And why the /etc/init.d/mysqld (this is a shell script)
still has some hard-coded configuration information even we already
have 3 copies of my.cnf? I had assume it should be able to retrieve
conf info from conf files, and this was what the role of a conf file
supposed to be ....

>
> To make things a bit more complicated, you cannot only start the server
> with the socket option, but also the client (mysql). In the my.cnf's
> mentioned above, also check for
>
> [client]

OK, I added this entry into my.cnf, and it does help for connection issued
from command line, but it doesn't work for PHP connection function (issued
drom web).

Alex Shi


>
> and
>
> [mysql]
>
> and see if socket=/var/lib/mysql/mysql.sock is specified anywhere.
>
> HTH,
> --
>   Stefan Hinz <[EMAIL PROTECTED]>
>   Geschäftsführer / CEO iConnect GmbH <http://iConnect.de>
>   Heesestr. 6, 12169 Berlin (Germany)
>   Tel: +49 30 7970948-0  Fax: +49 30 7970948-3
>
> ----- Original Message -----
> From: "Alex Shi" <[EMAIL PROTECTED]>
> To: "mysql group" <[EMAIL PROTECTED]>
> Sent: Sunday, February 02, 2003 12:03 AM
> Subject: datadir and socket
>
>
> > Hi,
> >
> > I have a MySQL 2.23.36 running on a Linux RH 7.1. Its database
> directory
> > is /var/lib/mysql/. For some reason I want to change it to
> /home/mysql/. So
> > I did following things:
> >
> > 1. modify /etc/my.cnf: changed all /var/lib/mysql/ to /home/mysql/
> > 2. modyfy /etc/init.d/mysqld: changed /var/lib/mysql/ to /home/mysql/
> > 3. copied all database files from /var/lib/mysql/ to /home/mysql/
> > 4. restart mysqld
> >
> > OK. everything looks fine for connections from foreign machines.
> > However, for local connections, say connections from a locally hosted
> > web site via PHP, or a command line connection issued from shell, it
> > will return following error message:
> > Can't connect to local MySQL server through socket
> > '/var/lib/mysql/mysql.sock'
> >
> > This was weird, since I had assumed that I made all the neccary
> changes
> > in /etc/my.cnf and /etc/init.d/mysqld.
> >
> > Seems like mysql has some configure information hard-coded into
> > its buildup or whatever, and cannot be modified after installation?
> >
> > Alex Shi
> >
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to