PDA

View Full Version : mysql connect problem


symmetry
30th April 2006, 10:40
Hello,

when I try to login via phpmyadmin, I get the following error:

#2002 - Der Server antwortet nicht. (evtl. ist auch der Socket des lokalen MySQL-Servers socket nicht korrekt konfiguriert)

and when I try to start the database:

Starting MySQL database server: mysqld...failed.
Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

syslog :(
less /var/log/syslog
/var/log/syslog: No such file or directory


can someone help me?
Thanks a lot

till
30th April 2006, 11:04
Which linux distribution do you use?

Did you install the mysql package that comes with your linux distribution?

symmetry
30th April 2006, 11:21
I have a Debian Sarge installation.
It was already installed when I got the root server. They made a Lamp installation.

and when I want do remove mysql he says the following:

apt-get --purge remove mysql
Reading Package Lists... Done
Building Dependency Tree... Done
Package mysql is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

falko
30th April 2006, 14:20
It seems as if MySQL isn't installed. Install it now.
It's strange that /var/log/syslog doesn't exist on your Debian system... :confused:

symmetry
30th April 2006, 21:00
yes it's very strange

but I am able to start mysql, he gives me an error... so it must be installed.

symmetry
1st May 2006, 12:49
syslog works again

here the error that mysql causes:


May 1 14:54:55 localhost /etc/init.d/mysql[13283]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
May 1 14:54:55 localhost /etc/init.d/mysql[13283]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
May 1 14:54:55 localhost /etc/init.d/mysql[13283]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
May 1 14:54:55 localhost /etc/init.d/mysql[13283]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
May 1 14:54:55 localhost /etc/init.d/mysql[13283]:

falko
1st May 2006, 14:53
Please try this: apt-get install mysql-server mysql-client libmysqlclient12-dev

symmetry
1st May 2006, 19:48
apt-get install mysql-server mysql-client libmys
qlclient12-dev
Reading Package Lists... Done
Building Dependency Tree... Done
mysql-server is already the newest version.
mysql-client is already the newest version.
The following extra packages will be installed:
zlib1g-dev
The following NEW packages will be installed:
libmysqlclient12-dev zlib1g-dev
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 3409kB of archives.
After unpacking 9064kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://85.10.192.16 sarge/main zlib1g-dev 1:1.2.2-4.sarge.2 [488kB]
Get:2 http://85.10.192.16 sarge/main libmysqlclient12-dev 4.0.24-10sarge1 [2921k
B]
Fetched 3409kB in 0s (5424kB/s)
Selecting previously deselected package zlib1g-dev.
(Reading database ... 33552 files and directories currently installed.)
Unpacking zlib1g-dev (from .../zlib1g-dev_1%3a1.2.2-4.sarge.2_i386.deb) ...
Selecting previously deselected package libmysqlclient12-dev.
Unpacking libmysqlclient12-dev (from .../libmysqlclient12-dev_4.0.24-10sarge1_i3
86.deb) ...
Setting up zlib1g-dev (1.2.2-4.sarge.2) ...
Setting up libmysqlclient12-dev (4.0.24-10sarge1) ...


But I still get the same error :(

falko
1st May 2006, 20:04
What's in /etc/mysql/my.cnf? What's the output of netstat -tap and ps aux|grep mysql?

symmetry
2nd May 2006, 07:20
/etc/mysql/my.cnf:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "/var/lib/mysql/my.cnf" to set server-specific options or
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
#
# * Query Cache Configuration
#
query_cache_limit = 1048576
query_cache_size = 16777216
query_cache_type = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql.log
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log-slow-queries = /var/log/mysql/mysql-slow.log
#
# The following can be used as easy to replay backup logs or for replication.
#server-id = 1
log-bin = /var/log/mysql/mysql-bin.log
# See /etc/mysql/debian-log-rotate.conf for the number of files kept.
max_binlog_size = 104857600
#binlog-do-db = include_database_name
#binlog-ignore-db = include_database_name
#
# * BerkeleyDB
#
# The use of BerkeleyDB is now discouraged and support for it will probably
# cease in the next versions.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Feature
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# If you want to enable SSL support (recommended) read the manual or my
# HOWTO in /usr/share/doc/mysql-server/SSL-MINI-HOWTO.txt.gz
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M




netstat -tap:


Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 *:sunrpc *:* LISTEN 1
906/portmap
tcp 0 0 *:10000 *:* LISTEN 2
659/perl
tcp 0 0 *:www *:* LISTEN 2
593/apache
tcp 0 0 *:auth *:* LISTEN 2
327/inetd
tcp 0 0 localhost.locald:domain *:* LISTEN 2
273/named
tcp 0 0 xxxx.ne:domain *:* LISTEN 2
273/named
tcp 0 0 localhost.localdoma:953 *:* LISTEN 2
273/named
tcp 0 0 *:634 *:* LISTEN 2
572/rpc.statd
tcp6 0 0 *:pop3 *:* LISTEN 2
318/couriertcpd
tcp6 0 0 *:ssh *:* LISTEN 2
565/sshd
tcp6 0 0 ip6-localhost:953 *:* LISTEN 2
273/named
tcp6 0 356 xxxx.net:ssh dslb-085-027-112-0:3224 ESTABLISHED4







root 2306 0.0 0.0 1752 384 ? S May01 0:00 /usr/sbin/courierlogger -pid=/var/run/courier/authdaemon/pid -start /usr/lib/courier/authlib/authdaemond.mysql
root 2307 0.0 0.0 2428 652 ? S May01 0:00 /usr/lib/courier/authlib/authdaemond.mysql
root 2312 0.0 0.0 2428 324 ? S May01 0:00 /usr/lib/courier/authlib/authdaemond.mysql
root 2313 0.0 0.0 2428 324 ? S May01 0:00 /usr/lib/courier/authlib/authdaemond.mysql
root 2314 0.0 0.0 2428 324 ? S May01 0:00 /usr/lib/courier/authlib/authdaemond.mysql
root 2315 0.0 0.0 2428 324 ? S May01 0:00 /usr/lib/courier/authlib/authdaemond.mysql
root 2316 0.0 0.0 2428 324 ? S May01 0:00 /usr/lib/courier/authlib/authdaemond.mysql
root 4069 0.0 0.0 1912 584 pts/0 R+ 09:27 0:00 grep mysql

falko
2nd May 2006, 15:14
Looks ok. What's the output of ls -la /var/run/mysqld?

symmetry
2nd May 2006, 16:31
ls -la /var/run/mysqld:


total 8
drwxr-xr-x 2 mysql mysql 4096 2006-05-01 21:52 .
drwxr-xr-x 13 root root 4096 2006-05-01 21:51 ..

falko
3rd May 2006, 15:53
What's the output of ls -la /var/run?

symmetry
3rd May 2006, 17:39
ls -la /var/run :


total 104
drwxr-xr-x 13 root root 4096 2006-05-01 21:51 .
drwxr-xr-x 15 root root 4096 2006-04-27 13:21 ..
drwxr-xr-x 2 root root 4096 2005-11-18 16:32 apache2
-rw-r--r-- 1 root root 5 2006-05-01 21:51 apache.pid
-rw-r--r-- 1 root root 5 2006-05-01 21:51 atd.pid
drwxr-xr-x 3 root root 4096 2006-04-27 12:14 bind
drwxr-xr-x 3 daemon daemon 4096 2006-05-01 21:50 courier
-rw-r--r-- 1 root root 5 2006-05-01 21:51 crond.pid
---------- 1 root root 0 2006-05-01 21:51 crond.reboot
drwxr-x--- 2 Debian-exim Debian-exim 4096 2006-04-27 12:12 exim4
drwxr-xr-x 2 identd nogroup 4096 2006-02-21 14:45 identd
-rw-r--r-- 1 root root 5 2006-05-01 21:50 inetd.pid
-rw-r--r-- 1 root root 5 2006-05-01 21:50 klogd.pid
-rw-r--r-- 1 root root 5 2006-05-01 21:50 lpd.pid
drwxr-xr-x 2 mysql mysql 4096 2006-05-01 21:52 mysqld
drwxr-xr-x 2 root root 4096 2005-03-23 19:04 pppconfig
drwxr-xr-x 2 root root 4096 2006-05-01 21:51 proftpd
-rw-r--r-- 1 root root 5 2006-05-01 21:51 rpc.statd.pid
drwxrwxr-x 3 root utmp 4096 2006-04-27 11:59 screen
-rwx------ 1 root root 0 2006-05-01 21:51 sessiondb.dir
-rwx------ 1 root root 1024 2006-05-01 21:51 sessiondb.pag
drwxr-xr-x 2 root root 4096 2004-11-28 16:33 sshd
-rw-r--r-- 1 root root 5 2006-05-01 21:51 sshd.pid
-rw-r--r-- 1 root root 5 2006-05-01 21:50 syslogd.pid
drwxr-xr-x 2 root root 4096 2005-04-07 18:37 usb
-rw-rw-r-- 1 root utmp 5376 2006-05-03 19:45 utmp
-rw-r--r-- 1 root root 5 2006-05-01 21:51 webmin.pid