Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Apr 2004 18:08:14 +0100
From:      Peter Risdon <peter@circlesquared.com>
To:        Micah Bushouse <bushous2@msu.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: MySQL
Message-ID:  <4084077E.1050105@circlesquared.com>
In-Reply-To: <40840127.5040102@msu.edu>
References:  <opr6hhnifjkmugx5@mail.onego.ru> <4083FED9.1070605@circlesquared.com> <40840127.5040102@msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Micah Bushouse wrote:

> <cut>
>
> Peter Risdon wrote:
>
>> ilich wrote:
>>
>>>
>>>
>>> Hello All!
>>> I have small problem.
>>> I installed apache2\php4\mysql. Apache and php work fine, but mysql 
>>> doesn't work. When I enter "mysql" to my console it send massage 
>>> "Can't connect to local MySQL server through socket 
>>> 'tmp/mysql.socket'". As far as I Know mysqld doesn't load to memory, 
>>> but I'm not sure.Please, give me any advices and explain me what 
>>> does mean this massage.
>>
>>
>>
>>
>> You probably need to start mysql:
>>
>> #/usr/local/etc/rc.d/mysql-server.sh start
>>
>> PWR
>
<paste>
I think you're actually trying to start the mysql client, which defaults 
to attempt a connection localhost when no cmd arguments are given. Since 
mysqld isn't running, the mysql client will complain about the socket.  
If you're using mysql 4.x (mysql 3.x will be very similar, except the 
daemon may be named safe_mysqld), try these steps:

 > whereis mysqld_safe

then run as root the resulting path, for example, on my machine I would use

 > /usr/local/bin/mysqld_safe &

that should work!

~Micah
</paste>


That's what the startup script does:


# less /usr/local/etc/rc.d/mysql-server.sh
#!/bin/sh

DB_DIR=/var/db/mysql
PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid

case "$1" in
        start)
                if [ -x /usr/local/bin/mysqld_safe ]; then
                        /usr/bin/limits -U mysql \
                        /usr/local/bin/mysqld_safe --user=mysql 
--datadir=${DB_DI
R} --pid-file=${PIDFILE} > /dev/null &
                        echo -n ' mysqld'
                fi
                ;;


But I'd use this rc.d script if there's a problem like the OP reported 
because it will govern how the daemon starts when the machine boots, so 
it needs to be working.

PWR.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4084077E.1050105>