Click to See Complete Forum and Search --> : mysql --- mysql.sock not found


robin1
10-12-2003, 05:48 PM
Hello everybody,

The problem I’m having has been discussed many times over but I haven’t been able to locate a conclusive answer to resolve my issue..

The error message I get starting mysql t à error 2002: Can’t connect to local mysql server through socket ‘/tmp/mysql.sock’(2).

Before I installed mysql, I looked at several different installation methods and was able to successfully install mysql. The instructions I installed from: http://www.dmxzone.com/ShowDetail.asp?NewsId=1215.

-Redhat 9
-downloaded the source code and compiled and installed mysql v4.
-only thing I haven’t done is change the password but that’s another problem I’m having..
I looked in /tem/mysql.sock and nothing there to be found.. I’m new so I’m assuming this file gets created at Mysql startup.
did a search for mysql.sock and it’s no where to be found.
-mysql is installed under /wwwroot/mysql
tried the following commands to start the mysql server…/wwwroot/mysql/bin/mysql start( displays the above message). …/wwwroot/mysql/bin/mysqld_safe –user=mysql &(msg=command not found), /wwwroot/mysql/lib/mysql start still no go…alos tried mysql.server.

my.cnf –port is pointing to 3306

-my research, also pointed to this folder /var/lib/mysql/mysql.sock but mysql.sock isn’t there either..

3 days of reading and figuring out whats wrong with mysql hasn’t produced any results.
What am I missing other then my hair that I lost trying to figure this out…

Help
Robin

kevinatkins
10-12-2003, 07:33 PM
hi robin,

i'm a bit hazy on this because it's a few months since i played with mysql...

you need first to start the mysql server daemon, without which, no socket will be created;

to do this, and assuming this is the first time you've used the server, go into the directory where mysql is installed and type the following command:

safe_mysqld (remember, mysqld - not just mysql)

if mysqld (the server) starts ok, to test the server, type -

mysqladmin -u root status (the 'root' user in this case relates to the root database user, *not* system root!)

the next thing that you really ought to do is set a root password. to do this, issue the following command -

mysqladmin -u root password "your password"

once done, you can connect to the database server with the mysql client. to do this, issue the command -

mysql -u root -p

whereupon you will be asked for your password. you'll then end up with a mysql prompt:

mysql>

and you can then start playing with databases

hope this helps. have fun!!

robin1
10-12-2003, 08:06 PM
hi kevinatkins,

Thanks for the reply... the problem still remains... i installed mysql under /wwwroot/mysql and the mysqld_safe is located in /wwwroot/mysql/bin...
when into the bin folder and typed "mysqld_safe" (i verified and the file is there), and received the msg, command not found...

i have a feeling a startup script doesn;t know that mysql is installed in /wwwroot/mysql.. is this possible....saying this because when i typed in mysqld_safe it displayed the message command not found...

tried typing in mysqladmin -root status and it displayed the same message about mysql.sock connecton issue, the original message...

any other suggestions

robin

kevinatkins
10-13-2003, 06:08 AM
hi robin1,

i've just re-read your original post and i think i was a bit off-course with my first reply - sorry!

anyway, i'm just wondering if this could be a file permissions issue..?

i've just re-installed and set up mysql on my machine, to refresh my memory, and file permissions were certainly a bit of an issue.

the first thing to address is the business of safe_mysqld - command not found.

my guess here is that your safe_mysqld script has not been set as 'executable'. to verify this, open up a terminal and go to the working directory of mysql, and instead of typing 'safe_mysqld --user=mysql &', try './safe_mysqld --user=mysql &', ie - add a dot and forward slash in front of the command.

this should at least give some output - post back and we'll see what's needed next.

robin1
10-13-2003, 09:18 AM
Hi Kevintkins,

Thanks for getting back to me on this problem i greatly appreciate the help.

going back to your last posting, i though about the permissions to and changed the dir //wwwroot/mysql to 777, rebooted the pc and tried again with the same results...

On the other hand we are getting close to resolving the problem but like u said it could be permission problem still..
i typed in what u said in the last posting:

[root@voyager /]# cd /wwwroot/mysql
[root@voyager mysql]# safe_mysqld --user=mysql &
[1] 2781
[root@voyager mysql]# Starting mysqld daemon with databases from /var/mysqldata
031013 09:13:09 mysqld ended

safe_mysqld --user=root &
[2] 2811
[1] Done safe_mysqld --user=mysql
[root@voyager mysql]# Starting mysqld daemon with databases from /var/mysqldata
031013 09:13:19 mysqld ended

[2]+ Done safe_mysqld --user=root
[root@voyager mysql]# ps -aux|grep mysqld
root 2843 0.0 0.5 3572 628 pts/0 S 09:14 0:00 grep mysqld
[root@voyager mysql]#

now its just starting and ending the so called daemon...

fredg
10-13-2003, 09:47 AM
You would have been much better off downloading and installing the RPMs. Those will give you an installed configuration that works out of the box.

theN
10-14-2003, 07:36 AM
safe_mysqld --user=mysql & Do you have a linux-user by the name mysql? Who owns MySQL's bin and data folders? What does the log in data folder say about your startup errors?

regards
akr