Current time: 11-15-2024, 07:17 AM Hello There, Guest! (LoginRegister)


Post Reply 
[ CLOSED ] Connection failed: SQLSTATE[HY000] [2002]
Author Message
CHBIE Offline
Junior Member
*

Posts: 225
Joined: May 2008
Reputation: 11
Post: #1
[ CLOSED ] Connection failed: SQLSTATE[HY000] [2002]
Hi Leute

letzte Nacht den Server normal Heruntergefahren und Heute Morgen gestartet es erscheint folgende Fehlermeldung:

Code:
Connection failed: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Die beiden Logs (mysql.err & mysql.log) sind LEER!

Ferner fehlen folgende Einträge in der /var/run/mysqld:

Code:
mysqld.pid
mysqld.sock

habe die zwei Einträge Manuel angelegt, Besitzer auf mysql geändert, schreibrechte angepasst.

Server neu gestartet und die Einträge in /var/run/mysqld waren wieder weg!

weiss jemand Rat?

Ausgabe in der Konsole:

Code:
alpha:~# /etc/init.d/mysql start
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

Code:
alpha:~# mysqld
090202  8:41:15  InnoDB: Started; log sequence number 0 43655
090202  8:41:15 [Note] Recovering after a crash using /var/log/mysql/mysql-bin
090202  8:41:15 [Note] Starting crash recovery...
090202  8:41:15 [Note] Crash recovery finished.
090202  8:41:15 [ERROR] mysqld: Incorrect information in file: './mysql/user.frm'
090202  8:41:15 [ERROR] mysqld: Incorrect information in file: './mysql/user.frm'
090202  8:41:15 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect information in file: './mysql/user.frm'

wo finde ich diesen Eintrag: ./mysql/user.frm

Danke und Gruss CHBIE
(This post was last modified: 02-02-2009 06:51 PM by CHBIE.)
02-02-2009 03:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zothos Offline
Release Manager
*****
Dev Team

Posts: 1,262
Joined: Feb 2007
Reputation: 10
Post: #2
RE: Connection failed: SQLSTATE[HY000] [2002]
was sagt dir denn /var/log/messages (oder vergleichbare log welche einfach alles was auf dem server passiert beinhaltet)?
(This post was last modified: 02-02-2009 04:51 PM by Zothos.)
02-02-2009 04:51 PM
Find all posts by this user Quote this message in a reply
CHBIE Offline
Junior Member
*

Posts: 225
Joined: May 2008
Reputation: 11
Post: #3
RE: Connection failed: SQLSTATE[HY000] [2002]
syslog:

Code:
Feb  2 08:57:01 alpha mysqld_safe[1963]: started
Feb  2 08:57:01 alpha mysqld[1966]: 090202  8:57:01  InnoDB: Started; log sequence number 0 43655
Feb  2 08:57:02 alpha mysqld[1966]: 090202  8:57:02 [Note] Recovering after a crash using /var/log/mysql/mysql-bin
Feb  2 08:57:02 alpha mysqld[1966]: 090202  8:57:02 [Note] Starting crash recovery...
Feb  2 08:57:02 alpha mysqld[1966]: 090202  8:57:02 [Note] Crash recovery finished.
Feb  2 08:57:02 alpha mysqld[1966]: 090202  8:57:02 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/user.frm'
Feb  2 08:57:02 alpha mysqld[1966]: 090202  8:57:02 [ERROR] /usr/sbin/mysqld: Incorrect information in file: './mysql/user.frm'
Feb  2 08:57:02 alpha mysqld[1966]: 090202  8:57:02 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect information in file: './mysql/user.frm'
Feb  2 08:57:02 alpha mysqld_safe[1977]: ended
Feb  2 08:57:10 alpha kernel: eth1: no IPv6 routers present
Feb  2 08:57:15 alpha /etc/init.d/mysql[2112]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Feb  2 08:57:15 alpha /etc/init.d/mysql[2112]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Feb  2 08:57:15 alpha /etc/init.d/mysql[2112]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Feb  2 08:57:15 alpha /etc/init.d/mysql[2112]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Feb  2 08:57:15 alpha /etc/init.d/mysql[2112]:

Gruss CHBIE
02-02-2009 05:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #4
RE: Connection failed: SQLSTATE[HY000] [2002]
Die Tabelle mit den MySQL Benutzern scheint kaputt zu sein.

Da hilft wohl nur: mysql starten ohne Berechtigungsüberprüfung und diese Tabelle reparieren oder aus einem Backup wiederherstellen.

/Joxi
02-02-2009 05:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
CHBIE Offline
Junior Member
*

Posts: 225
Joined: May 2008
Reputation: 11
Post: #5
RE: Connection failed: SQLSTATE[HY000] [2002]
(02-02-2009 05:14 PM)joximu Wrote:  mysql starten ohne Berechtigungsüberprüfung

und wie soll ich das anstellen?

Gruss CHBIE
02-02-2009 05:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: Connection failed: SQLSTATE[HY000] [2002]
shell> /usr/bin/mysqld_safe --user=mysql --skip-grant-tables &

und dann einfach

shell> /usr/bin/mysql mysql


und dann musst du die Tabelle user reparieren:

mysql> REPAIR TABLE user
ggf \g hintendran...

quit und mysql nochmals komplett beenden/neustarten...

und hoffen...

Gruss Joxi
02-02-2009 06:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
CHBIE Offline
Junior Member
*

Posts: 225
Joined: May 2008
Reputation: 11
Post: #7
RE: [ CLOSED ] Connection failed: SQLSTATE[HY000] [2002]
Funktioniert So nicht weil meine DB TotalSchaden hat - und das Backup nicht zu gebrauchen ist - weil TotalSchaden ebenfalls vorhanden.

Habe in der zwischenzeit einen anderen TestServer aufgesetzt und in Betrieb genommen.

Hoffe der Fehler wiederholt sich nicht wieder. 3fach Backup der wichtigsten Daten Hilft immer.

Danke und Gruss CHBIE
02-02-2009 06:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)