Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Wed, 30 Dec 2009 09:54:57



Maybe I was doing it as the wrong user? I did this and got a
different message.
sh-3.2# ./bin/mysqld --user=_mysql
091228 16:50:37 [ERROR] Can't find messagefile '/usr/local/
mysql-5.1.40-osx10.5-powerpc/bin/share/english/errmsg.sys'
091228 16:50:37 [Warning] Setting lower_case_table_names=2 because
file system for /usr/local/mysql-5.1.40-osx10.5-powerpc/data/ is case
insensitive
091228 16:50:37 [Note] Plugin 'FEDERATED' is disabled.
../bin/mysqld: Unknown error 1146
091228 16:50:37 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.
091228 16:50:38 InnoDB: Started; log sequence number 0 44233
091228 16:50:38 [ERROR] Aborting

091228 16:50:38 InnoDB: Starting shutdown...
091228 16:50:39 InnoDB: Shutdown completed; log sequence number 0
44233
091228 16:50:39 [Note]

What is the mysql_update and the federated plugin?
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Wed, 30 Dec 2009 11:04:01

n Dec 28, 4:22m, JRough < XXXX@XXXXX.COM > wrote:

Well I might have started the server. Thanks
jlrough$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
Password:
Starting MySQL database server

however, to double-check I did ps aux | grep mysql to see if it
started a process and I didn't see any mysql processes?
MySQLAdmin connection dialog said starting database server and I
didn't get an error message but that is the startup item alias . I
did open MySQLAdministrator to see if I had a MySQL instance and it
said could not connect however it tried to connect to the old socket
in /tmp/mysql.sock . the exact message is
"Could not connect to MySQL instance at localhost. Canot connect to
local mysql server through socket 'tmp/mysql.sock(2)"
How can I tell if a old mysql.sock is in /tmp/mysql.sock

I tried mysqld and got the message above:
sh-3.2# /usr/local/mysql/bin/mysqld
091228 18:01:29 [ERROR] Can't find messagefile '/usr/local/
mysql-5.1.40-osx10.5-powerpc/bin/share/english/errmsg.sys'
091228 18:01:29 [Warning] Setting lower_case_table_names=2 because
file system for /usr/local/mysql-5.1.40-osx10.5-powerpc/data/ is case
insensitive
091228 18:01:29 [ERROR] Fatal error: Please read "Security" section of
the manual to find out how to run mysqld as root!

091228 18:01:29 [ERROR] Aborting

091228 18:01:29 [Note]
sh-3.2#

When I start mysqld it seems to die.
sh-3.2# ./bin/mysqld_safe &
[1] 1722
sh-3.2# 091228 18:03:05 mysqld_safe Logging to '/usr/local/
mysql-5.1.40-osx10.5-powerpc/data/janis-roughs-power-mac-
g5.local.err'.
091228 18:03:06 mysqld_safe Starting mysqld daemon with databases
from /usr/local/mysql-5.1.40-osx10.5-powerpc/data
091228 18:03:07 mysqld_safe mysqld from pid file /usr/local/
mysql-5.1.40-osx10.5-powerpc/data/janis-roughs-power-mac-g5.local.pid
ended

thanks,

What am I looking for? In /private/tmp there is no mysql.sock. No
hidden files nothing.

 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Wed, 30 Dec 2009 13:08:43

> > When I start mysqld it seems to die.

I believe this is the error log. It looks like the output of a
previous message but I checked the time of the log.

091228 20:03:39 mysqld_safe Starting mysqld daemon with databases
from /usr/local/mysql-5.1.40-osx10.5-powerpc/data
091228 20:03:39 [ERROR] Can't find messagefile '/usr/local/
mysql-5.1.40-osx10.5-powerpc/bin/share/english/errmsg.sys'
091228 20:03:39 [Warning] Setting lower_case_table_names=2 because
file system for /usr/local/mysql-5.1.40-osx10.5-powerpc/data/ is case
insensitive
091228 20:03:39 [Note] Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: Unknown error 1146
091228 20:03:39 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.
091228 20:03:39 InnoDB: Started; log sequence number 0 44233
091228 20:03:39 [ERROR] Aborting

091228 20:03:39 InnoDB: Starting shutdown...
091228 20:03:40 InnoDB: Shutdown completed; log sequence number 0
44233
091228 20:03:40 [Note]
091228 20:03:41 mysqld_safe mysqld from pid file /usr/local/
mysql-5.1.40-osx10.5-powerpc/data/janis-roughs-power-mac-g5.local.pid
ended
~

~
"logs.err" 13L, 959C


Well the MySQL admin was looking for it in the previous location.
Should I uninstall it or will it find the right one as soon as it is
working. At this point I don't care I just want to get mysql started.


thanks,
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Wed, 30 Dec 2009 13:26:47


Is mysql 5.1.40 built for Innodb engine? That is a guess. In my.conf
it says default type is myisam. Could that cause it to not be able to
find this plug-in or something?
default-storage-engine=myisam
[client]
socket=/var/mysql/mysql.sock
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Thu, 31 Dec 2009 05:23:55


I tried to compile from source and it didn't work so I tried the
installer. That didn't work. I only have 32 bit g5 not an Intel
Mac. I don't know if the older machine is an issue. I will try
installing Snow L:eopard on it and see if I can compile from source.
It has been a big pain. Back to square one again. I should have left
Tiger and MySQL on it but I didn't have the command line. The Mac
preinstalled version of mysql doesn't have the command line.
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Thu, 31 Dec 2009 05:24:36


that is the mac version of MySQL on Leopard which wrote over the
version that worked on Tiger.
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Thu, 31 Dec 2009 07:48:12


Well I didn't know the specs on the g5. You might have solved my
problems. I do have an intel macbook pro but don't want to install
mysql server on it for security reasons but I will if I have to.
Thanks though I will give it one more try on the g5.
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Thu, 31 Dec 2009 10:52:40


I tried reinstalling from the package file. No compile just regular
install. I checked a mysql user and group are created.
I got this in the error log:
91229 17:42:41 mysqld_safe Starting mysqld daemon with databases from /
usr/local/mysql-5.1.40-osx10.5-powerpc/data
091229 17:42:41 [ERROR] Can't find messagefile '/usr/local/
mysql-5.1.40-osx10.5-powerpc/bin/share/english/errmsg.sys'
091229 17:42:41 [Warning] Can't create test file /usr/local/
mysql-5.1.40-osx10.5-powerpc/data/janis-roughs-power-mac-g5.lower-test
091229 17:42:41 [Warning] Can't create test file /usr/local/
mysql-5.1.40-osx10.5-powerpc/data/janis-roughs-power-mac-g5.lower-test
^G/usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/
mysql-5.1.40-osx10.5-powerpc/data/' (Errcode: 2)
091229 17:42:41 [ERROR] Aborting

091229 17:42:41 [Note]
091229 17:42:41 mysqld_safe mysqld from pid file /usr/local/
mysql-5.1.40-osx10.5-powerpc/data/janis-roughs-power-mac-g5.local.pid
ended

Who should the data directory be owned by? I have it owned by mysql
user. I tried starting mysqld_safe as root and as mysql to see if it
made a difference and I got the same errors.

please help
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Thu, 31 Dec 2009 10:54:19


Do you have tiger or leopard on your g4? I had tiger working. I
think I had Leopard working without the command line. Now nothing
works. I think it was the preinstalled mysql version that comes with
Leopard.
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Fri, 01 Jan 2010 03:55:36

>
> #Path to installation directory. All paths are usually resolved> > #relative to thi>.
> basedir=/usr/local/mysql-5.1.40-osx10.5-powerpc/>in>
>
> Notice what it says in the comment? When mysqld is starting up, >t's
> looking for share/english/errmsg.sys *relative to the basedir* - th>t's
> where the incorrect bin/ is coming f>om>
>
> sherm--

Okay, thanks, very much I forgot to change my.conf. I took out the
extra bin and I changed the directory name to match the new install
pkg. Thankfully it is not saying a missing federated plug-in or can't
find the mysql.sock anymore :-)


Is it working? I didn't start with mysql user but I guess it
started that way on its own?
sh-3.2# ps aux | grep mysql
_mysql 64825 9.4 0.0 75944 744 ?? Rs 10:20AM
0:00.03 /bin/sh /usr/local/mysql/bin/mysqld_safe
_mysql 63487 0.0 0.0 75488 476 ?? Ss 10:18AM
0:00.05 /sbin/launchd

One last problem. I can't get mysqladmin to run.
/usr/local/mysql/bin/mysqladmin
gets a canned man page.
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
The following groups are read: mysqladmin client..............etc etc



Why doesn't mysqladmin CLI work? I can't get it to connect with the
MySQL Administrator app either. Is this something to do with
[client] in my.conf? What do I put in there? Is that why it doesn't
work?

thanks again,
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Fri, 01 Jan 2010 04:15:49


> #Path to installation directory. All paths are usually resolved> > #relative to thi>.
> basedir=/usr/local/mysql-5.1.40-osx10.5-powerpc/>in>
>
> Notice what it says in the comment? When mysqld is starting up, >t's
> looking for share/english/errmsg.sys *relative to the basedir* - th>t's
> where the incorrect bin/ is coming f>om>
>
> sherm--

I changed my.conf client to
[client]
/tmp/mysql.sock

I tried /usr/local/mysql/bin/mysqladmin -u root
and I just get the mysqladmin man page.

How do I ping MySQLServer?
thanks,
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Fri, 01 Jan 2010 12:16:00


I'm not sure mysql is really running. What is /sbin/launchd for?
There is a mysql process but I don't know if it is the mysqld. :-(
janis-roughs-power-mac-g5:bin jlrough$ !ps
ps aux | grep mysql
_mysql 106 0.0 0.0 75488 476 ?? Ss 12:42PM
0:05.72 /sbin/launchd

I pinged it and got the mysql.sock(2) error. :-(
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/
mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock'
exists!


I tried to start mysqladmin with the socket and that failed. I got
the man page again but it might not be running since I don't think the
demon is running.
/usr/local/mysql/bin/mysqladmin -S -socket=/tmp/mysql.sock

Should I reinstall mysql yet again? That will be painful since I
really don't know what is wrong.
Janis
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Sat, 02 Jan 2010 03:23:06

> I would want to verify that the mysql.sock is actually in /tmp/ folder.
janis-roughs-power-mac-g5:LaunchDaemons jlrough$ mysql -h 127.0.0.1 -u
root -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61)
janis-roughs-power-mac-g5:LaunchDaemons jlrough$ mysql -h 127.0.0.1 -u
mysql
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (61)

I don't understand this mysql.sock when does it get installed at start
up or when mysql is installed? Maybe I should change the my.conf and
the php.ini to be /var/msyql/mysql.sock to see if it works. I looked
in there and don't see a file named mysql.sock. I also looked in /
tmp/ and there is no file called mysql.sock.
php.ini:
mysql.default_socket= /tmp/mysql.sock
My.conf :
[client]
socket=/tmp/mysql.sock >> The far more likely answer is that the mysql isn't up and running. >> >> How did you start the server? Manually or automatically as a part of >> startup?

I put the com.mysql.mysqld.plist from HiveLogic in /Library/
LaunchDaemons, http://www.yqcomputer.com/
the instructions are for compiled mysql with snow leopard but I only
used the plist instructions:
janis-roughs-power-mac-g5:LaunchDaemons jlrough$ launchctl load -w /
Library/LaunchDaemons/com.mysql.mysqld.plist
janis-roughs-power-mac-g5:LaunchDaemons jlrough$ mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
janis-roughs-power-mac-g5:LaunchDaemons jlrough$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
janis-roughs-power-mac-g5:LaunchDaemons jlrough$ mysql -u _mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)

That was what the launchd was all about. It was from the plist. >> >>>> Should I reinstall mysql yet again? hat will be painful since I >>>> really don't know what is wrong. >>>> Janis >> >> I don't think so. See the above for possible troubleshooting steps.

Thanks,
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Sat, 02 Jan 2010 07:28:29


I couldn't su as admin and start it for some reason. presumably
because I have to set the grant tables. I tried to start it as mysql
and I tried to start it as root. I couldn't find a mysqld process.
Starting as root I got the starting message but it doesn't seem to
finish. All the mysql directories are owned by root except for the
data directory is owned by mysql.

h-3.2# /usr/local/mysql/bin/mysqld_safe
091231 14:22:06 mysqld_safe Logging to '/usr/local/mysql-5.1.40-
osx10.5-powerpc-64bit/data/janis-roughs-power-mac-g5.local.err'.
091231 14:22:06 mysqld_safe Starting mysqld daemon with databases
from /usr/local/mysql-5.1.40-osx10.5-powerpc-64bit/data
091231 14:22:07 mysqld_safe mysqld from pid file /usr/local/
mysql-5.1.40-osx10.5-powerpc-64bit/data/janis-roughs-power-mac-
g5.local.pid ended
sh-3.2# ps aux | grep mysql
_mysql 106 0.0 0.0 75488 476 ?? Ss Wed12PM
0:18.36 /sbin/launchd
root 40913 0.0 0.0 75516 484 s002 S+ 2:23PM 0:00.01
grep mysql
sh-3.2# su admin -c 'sudo /usr/local/mysql/bin/mysqld_safe'
su: unknown login: admin
sh-3.2# su mysql -c 'sudo /usr/local/mysql/bin/mysqld_safe'
sh-3.2# ps aux | grep mysql
_mysql 106 0.0 0.0 75488 476 ?? Ss Wed12PM
0:18.38 /sbin/launchd
thanks,
 
 
 

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) LEOPARD

Post by JRoug » Sat, 02 Jan 2010 07:40:27


P.S. I tried it with my User name in system preferences also. I
think that is the short name. Anyway it is the user name and it is
the admin account name as well. I got the same response.

anis-roughs-power-mac-g5:~ jlrough$ su jlrough -c 'sudo /usr/local/
mysql/bin/mysqld_safe'
Password:
Password:
091231 14:38:00 mysqld_safe Logging to '/usr/local/mysql-5.1.40-
osx10.5-powerpc-64bit/data/janis-roughs-power-mac-g5.local.err'.
091231 14:38:00 mysqld_safe Starting mysqld daemon with databases
from /usr/local/mysql-5.1.40-osx10.5-powerpc-64bit/data
091231 14:38:00 mysqld_safe mysqld from pid file /usr/local/
mysql-5.1.40-osx10.5-powerpc-64bit/data/janis-roughs-power-mac-
g5.local.pid ended
janis-roughs-power-mac-g5:~ jlrough$ ps aux | grep mysql
_mysql 106 0.0 0.0 75488 476 ?? Ss Wed12PM
0:18.59 /sbin/launchd
janis-roughs-power-mac-g5:~ jlrough$