PDA

View Full Version : Error connecting to MySQL



zEitEr
05-06-2005, 01:01 AM
I've got an error:

Error connecting to MySQL: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

DA just recently installed on FreeBSD 5.3 server....


Logs:

50505 18:19:56 mysqld endeqld started
050505 18:19:56 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
050505 18:19:56 [ERROR] Do you already have another mysqld server running on port: 3306 ?
050505 18:19:56 [ERROR] Aborting
050505 18:19:56 [Note] /usr/local/mysql-4.1.11-unknown-freebsd5.1-i386/bin/mysql
d: Shutdown complete

050505 18:19:56 mysqld ended


I'm not sure if MySQL ever worked...

ssh:

# mysqld
mysqld: Command not found.
# locate mysqld
/usr/ports/databases/mysql323-server/files/patch-sql_mysqld.cc
/usr/ports/databases/mysql40-server/files/patch-sql::mysqld.cc
/usr/ports/databases/mysql41-server/files/patch-sql::mysqld.cc
/usr/ports/databases/mysql50-server/files/patch-sql::mysqld.cc
/usr/ports/www/zope-zmysqlda
/usr/ports/www/zope-zmysqlda/Makefile
/usr/ports/www/zope-zmysqlda/distinfo
/usr/ports/www/zope-zmysqlda/pkg-descr
/usr/ports/www/zope-zmysqlda/pkg-message
/usr/ports/www/zope-zmysqlda/pkg-plist

Is it ok?

What should I do?

jmstacey
05-06-2005, 11:59 PM
Check /usr/local/mysql
Kill all processes of MySQL before trying to start. Restarting your server will also accomplish this.
Then try to access MySQL directly from the command line again. If it still can't find the mysqld command, locate the mysqld binary in the bin directory of mysql's installation directory.

Or if you don't have any data to lose, run MySQL's installation again. I think the script can be found in /usr/local/directadmin/scripts/
named mysql.sh or similar.

zEitEr
05-07-2005, 02:11 AM
That's, what I've got now:

http://xxxx:2222/CMD_SYSTEM_INFO

Apache 1.3.33 Running
DirectAdmin Running
Exim 4.50 Running
MySQL 4.1.11 Running
Named 9.3.0 Running
ProFTPd 1.2.10 Running
sshd Running
vm-Pop3d 1.1.6 Running


# ps ax | grep mysql
647 ?? S 0:36.82 /usr/local/mysql-4.1.11-unknown-freebsd5.1-i386/bin/mysqld --
553 con- I 0:00.01 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql --datad

and...

# /usr/local/etc/rc.d/mysqld stop
Stopping mysqld: [ FAILED ]

It's running.... but I still have an error "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"

#locate mysql.sock - shows nothing :(

What should I do? Please, help.

jmstacey
05-07-2005, 05:01 PM
Did you try killing all the processes of mysql? If DirectAdmin is seeing MySQL as running, there are still mysql processes running around.

Use kill ;)

zEitEr
05-08-2005, 02:43 AM
Oh, yes!

It worked!

I've killed all the processes of mysql.... and started again... now it's OK....


Thanks ;)

vigodagod
10-19-2005, 06:19 AM
I had the same issue and this fixed it for me.

I attempted to stop mysql
/usr/local/etc/rc.d/mysqld stop

It failed.

Then I located a reference to a data file in a file called services.status in a mysql.sh script.
/usr/local/directadmin/scripts/mysql.sh
/usr/local/directadmin/data/admin/services.status

In that file there is a list of services and their status. (duh :rolleyes: )



directadmin=ON
exim=ON
httpd=ON
mysqld=ON
named=ON
proftpd=ON
sshd=ON
vm-pop3d=ON


I edited the file to say

mysqld=OFF


and attempted to stop mysql again. This time it worked. I then restarted mysql and was able to access the database.

nobaloney
10-22-2005, 08:47 PM
If you don't change it back to ON, then DA will no longer manage MySQL for you.

Jeff