[Linux] MySql ist kaputt

Raage

New Member
Hiho liebe Community einer meiner Teammitglieder hat es geschafft irgendwie MySQL zu schrotten, zuerst dachte ich er hätte nur die benutzer gelöscht aber dann fiel mir auf das als ich die benutzer wiederhergestellt hatte das irgendwie alles net mehr richtig funzte.

wenn ich mysql start eingebe kommt folgendes:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Ich habe MySql auch schon neu installiert via. apt-get install mysql-server mysql-common mysql-client

auch das funkte net dann habe ich es removed und nochmal installiert und es kam folgendes:

Setting up libdbd-mysql-perl (3.0008-1) ...
Setting up mysql-client-5.0 (5.0.32-7etch10) ...
Setting up mysql-server-5.0 (5.0.32-7etch10) ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..

Setting up mysql-client (5.0.32-7etch10) ...
Setting up mysql-server (5.0.32-7etch10) ...
l-wilkes:~# /etc/mysql/debian-start: line 27: check_root_accounts: command not found

In debian-start steht jedoch:

#!/bin/bash
#
# This script is executed by "/etc/init.d/mysql" on every (re)start.
#
# Changes to this file will be preserved when updating the Debian package.
#

source /usr/share/mysql/debian-start.inc.sh

MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
MYCHECK_PARAMS="--all-databases --fast --silent"
MYCHECK_RCPT="root"

# The following commands should be run when the server is up but in background
# where they do not block the server start and in one shell instance so that
# they run sequentially. They are supposed not to echo anything to stdout.
# If you want to disable the check for crashed tables comment
# "check_for_crashed_tables" out.
# (There may be no output to stdout inside the background process!)
echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
(
upgrade_system_tables_if_necessary;
check_root_accounts;
check_for_crashed_tables;
) >&2 &

exit 0

Mein OS ist Debian Etcht und emine frage ist gibt es irgendwie ne möglichkeit das in ordnung zu bringen?
 
Beim Removen werden wahrscheinlich die vorhandenen Datenbanken nicht gelöscht. Um einen wirklichen Neustart zu haben, müsstest Du vor dem Neu-Installieren der mysql-Pakete ein "rm -rf /var/lib/mysql" durchführen.

Einfacher wäre es übrigens gewesen den Benutzer (root) neu anzulegen. Wie das ohne Passwort geht, steht auf den Seiten des Herstellers. Links dahin liefert Dir die Suchmaschine Deines Vertrauens oder die Suchfunktion des Forums.
 
Code:
apt-get remove --purge [I]paketname[/I]
Sollte eleganter sein als die libs manuell zu löschen...;)
 
# mysqladmin --user=root password=meinpass
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

kommt raus nachdem ich alles removed habe mit und einen neuen root user anlegen möchte.

apt-get remove --purge paketname

nach

cd /etc/init.d/mysql start

kommt

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Ich habe alles mit

apt-get install mysql-server mysql-client mysql-common

war das richtig? oder wie was wo?^^
 
habe gerade was aufm server gefunden eine datei die mysqlpasswortaendern_sehll heißt der inhalt sieht so aus:

/etc/init.d/mysql stop
echo "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('PASS');" >~/setrootpassword.sql
mysqld_safe --init-file=~/setrootpassword.sql
#[ctrl]+[c]
/etc/init.d/mysql start
rm -f ~/setrootpassword.sql

kann ich damit was anfangen?
 
Hast Du nach dem Beenden (/etc/init.d/mysql stop) überprüft, ob der alte Mysqld-Prozess tatsächlich beendet wurde? Der scheint nämlich noch zu laufen.

PS: Das Script, mit dem Dein Kumpel das Passwort geändert hat, ist Müll! Die laufende Datenbank mit Ctrl-C zu beenden, ist nicht sonderlich ratsam. Du solltest besser aufpassen, wem Du wie Zugang zu Deinem Server gibst....
 
so mal ein ausschnitt wenn ich ps aux oder ps axw mache:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1948 660 ? Ss 09:37 0:01 init [2]
root 7246 0.0 0.2 8264 2340 ? Ss 14:32 0:00 sshd: root@nott
root 7250 0.0 0.1 4540 1196 ? Ss 14:32 0:00 /usr/lib/openss
root 9946 0.0 0.0 2224 764 pts/1 R+ 15:07 0:00 ps aux
root 11310 0.0 0.0 1628 576 ? Ss 09:37 0:00 /sbin/syslogd
polw 11652 0.0 0.7 9792 7688 ? Ss 09:38 0:00 policyd-weight
polw 11657 0.0 0.7 9792 7360 ? Ss 09:38 0:00 policyd-weight
postgrey 11664 0.0 0.7 10648 7868 ? Ss 09:38 0:00 /usr/sbin/postg
root 11678 0.0 2.9 33216 30768 ? Ss 09:38 0:00 /usr/sbin/spamd
root 11695 0.0 0.0 1752 404 ? S 09:38 0:00 /usr/sbin/couri
root 11696 0.0 0.0 1956 632 ? S 09:38 0:00 /usr/lib/courie
root 11701 0.0 0.0 1956 288 ? S 09:38 0:00 /usr/lib/courie
root 11702 0.0 0.0 1956 288 ? S 09:38 0:00 /usr/lib/courie
root 11703 0.0 0.0 1956 288 ? S 09:38 0:00 /usr/lib/courie
root 11704 0.0 0.0 1956 288 ? S 09:38 0:00 /usr/lib/courie
root 11706 0.0 0.0 1956 288 ? S 09:38 0:00 /usr/lib/courie
root 11712 0.0 0.0 1752 328 ? S 09:38 0:00 /usr/sbin/couri
root 11713 0.0 0.0 1856 544 ? S 09:38 0:00 /usr/sbin/couri
root 11721 0.0 0.0 1856 508 ? S 09:38 0:00 /usr/sbin/couri
root 11723 0.0 0.0 1620 320 ? S 09:38 0:00 /usr/sbin/couri
root 11729 0.0 3.0 35992 31484 ? S 09:38 0:00 spamd child
root 11731 0.0 2.7 33216 29128 ? S 09:38 0:00 spamd child
root 11738 0.0 0.0 8840 996 ? Ssl 09:38 0:00 /usr/sbin/nscd
root 11820 0.0 0.1 5380 1624 ? Ss 09:38 0:00 /usr/lib/postfi
postfix 11829 0.0 0.1 5164 1628 ? S 09:38 0:00 qmgr -l -t fifo
root 11845 0.0 0.0 7220 992 ? Ss 09:38 0:00 /usr/sbin/sasla
root 11846 0.0 0.0 7220 536 ? S 09:38 0:00 /usr/sbin/sasla
root 11852 0.0 0.1 5028 1072 ? Ss 09:38 0:00 /usr/sbin/sshd
root 11858 0.0 0.0 2404 772 ? Ss 09:38 0:00 /usr/sbin/xinet
root 12006 0.0 0.0 2204 720 ? Ss 09:38 0:00 /usr/sbin/cron
root 12032 0.0 0.0 1568 412 ? S 09:38 0:00 /var/www/ispcp/
root 12062 0.0 0.2 8316 2328 ? Ss 14:39 0:00 sshd: root@pts/
root 12066 0.0 0.1 2804 1504 pts/1 Ss 14:39 0:00 -bash
postfix 24124 0.0 0.1 5132 1556 ? S 14:10 0:00 pickup -l -t fi

kann mal einer gucken ob da noch was ist was auf sql zugreift^^
 
Öhm, läuft mysql denn überhaupt? Laut deiner Prozessliste nicht...klaro dass du dann auch nicht zugreifen kannst...^^
 
ich mache

mysql start und der server macht:

l-wilkes:/etc/init.d# mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
 
Hi,

dann mach mal
Code:
./mysql start
in dem Verzeichnis oder gib den vollen Pfad an, also
Code:
/etc/init.d/mysql start


-W
 
danke sieht vielversprechend aus wenn nicht tables fehlen würden^^

/etc/init.d/mysql start
Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
 
Und wo fehlen da jetzt Tables?
Code:
Starting MySQL database server: mysqld.
Wird doch wunderbar gestartet!!!

Code:
Checking for corrupt, not cleanly closed and upgrade needing tables..
Heißt nichts anderes, als dass er überprüft, ob kaputte Tabellen vorhanden sind.
 
so mal eben was ich gemacht habe^^

l-wilkes:~# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

l-wilkes:~# ps axw
PID TTY STAT TIME COMMAND
1 ? Ss 0:01 init [2]
11310 ? Ss 0:00 /sbin/syslogd
11652 ? Ss 0:00 policyd-weight (master)
11657 ? Ss 0:00 policyd-weight (cache)
11664 ? Ss 0:00 /usr/sbin/postgrey --pidfile=/var/run/postgrey.pid --daemonize --inet=127.0.0.1:60000
11678 ? Ss 0:00 /usr/sbin/spamd --sql-config --nouser-config --local --daemonize --max-children=2 -d --pidfile=/var/run/s
11695 ? S 0:00 /usr/sbin/courierlogger -pid=/var/run/courier/authdaemon/pid -start /usr/lib/courier/courier-authlib/auth
11696 ? S 0:00 /usr/lib/courier/courier-authlib/authdaemond
11701 ? S 0:00 /usr/lib/courier/courier-authlib/authdaemond
11702 ? S 0:00 /usr/lib/courier/courier-authlib/authdaemond
11703 ? S 0:00 /usr/lib/courier/courier-authlib/authdaemond
11704 ? S 0:00 /usr/lib/courier/courier-authlib/authdaemond
11706 ? S 0:00 /usr/lib/courier/courier-authlib/authdaemond
11712 ? S 0:00 /usr/sbin/courierlogger -pid=/var/run/courier/imapd.pid -start -name=imapd /usr/sbin/couriertcpd -address
11713 ? S 0:00 /usr/sbin/couriertcpd -address=0 -maxprocs=40 -maxperip=20 -nodnslookup -noidentlookup 143 /usr/lib/couri
11721 ? S 0:00 /usr/sbin/couriertcpd -pid=/var/run/courier/pop3d.pid -stderrlogger=/usr/sbin/courierlogger -maxprocs=40
11723 ? S 0:00 /usr/sbin/courierlogger courierpop3login
11729 ? S 0:04 spamd child
11731 ? S 0:00 spamd child
11738 ? Ssl 0:00 /usr/sbin/nscd
11820 ? Ss 0:00 /usr/lib/postfix/master
11829 ? S 0:00 qmgr -l -t fifo -u
11845 ? Ss 0:00 /usr/sbin/saslauthd -a pam -c -n 2
11846 ? S 0:00 /usr/sbin/saslauthd -a pam -c -n 2
11852 ? Ss 0:00 /usr/sbin/sshd
11858 ? Ss 0:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayalive
12006 ? Ss 0:00 /usr/sbin/cron
12032 ? S 0:00 /var/www/ispcp/daemon/ispcp_daemon -p /var/run/ispcp_daemon.pid
18424 ? S 0:00 pickup -l -t fifo -u -c
20144 ? Ss 0:00 sshd: root@pts/0
20151 pts/0 Ss+ 0:00 -bash
20234 pts/0 S 0:00 /bin/sh /usr/bin/mysqld_safe
20272 pts/0 Sl 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.p
20273 pts/0 S 0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
22080 ? Rs 0:00 sshd: root@pts/1
22196 pts/1 Ss 0:00 -bash
23568 pts/1 R+ 0:00 ps axw

mysql läöuft aber ich kann net druff zugreifen why?
 
habe folegndes gemacht:

mysqladmin --user=root password= hieristmeinpw

klappt auch net ich kriege da:

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'


sry für doppelspost
 
Back
Top