Hilfe mysql update nicht geht mehr..

Rabadag

Well-Known Member
:zitter: :zitter: :zitter: :zitter: :zitter: :zitter: :zitter: :zitter: :zitter:
Hi forum...

Hab auf meinem Webserver ein mysql update mit portupgrade -r von der
Version 4.1.1_1 nach 4.1.2 gemacht.
Update lief ohne Problehme durch.

Aber der schreck ist nah.
Kein einziger sql user hat zugriff auf die Datenbanken, als wären sie nimals erstellt worden.

ein
#mysql -uroot mysql
Access denied for user: ''@'localhost' to database 'msql'

#mysql -uroot -p mysql
Password:xxxx (damals gesetz)
Access denied for user: ''@'localhost' to database 'msql'

Was kann ich machen ?
 
mysql update 4.1.1_1 nach 4.1.2

Erstmal vilen Dank an Indy das du mir per ICQ echt geholfen hast mein Problehm
in den griff zu bekommen.

Damit nun alle was davon haben sovern das Problehm auch auftaucht versuche ich eine kleine zusammenfassung zu erstellen.

Befor Ihr jedoch ein mysql update macht empfehle ich mittels mysqldump die einzelnen db's inkl. der mysql db zu sichern.


Sitwation:
Nach einem ubdate mit
portupgrade -r mysql-4.1.1_1
portupgrade -aC
portupgrade -aRr

und folgende fehler im mysql entstehen.

1. Keine anmeldung an mysql mit root möglich sowie auch alle db user.
Der mysql server kann weder gestopt noch gestartet werden.
Ein dump zu importieren schlägt ebenfalss fehl.


#mysql -uroot -ppassword mysql
Access denied for user: 'root@localhost' (Using password: YES)

#mysql -uroot

Eingelogt als anonymous aber ohne irgeneine berechtigung also ein wechsel zur db mysql mit \u mysql hat zur folge
Access denied for user: 'root@localhost' (Using password: NO)

2. Passwordänderung mittels mysqladmin
Ist ein Password änderung auch nicht möglich so ist die
privileg db sowie die user db futsh.

3. ein dump importiren mittels
mysql -uroot -ppassword mysql < datenfile.sql
Access denied for user: 'root@localhost' (Using password: YES)


#nun zur etwas unconvenzionelen lösung.

1. Den mysql server beenden. Geht dies nicht dan mit

#killall mysqld
oder mit
#kill /var/db/mysql/hosname.pid


2. Datenbank mysql mittels
#mv /var/db/mysql /var/db/mysql-back
umbenennen oder mit rm -R löschen.

3. Script für das erstellen der mysql Grand Tables ausführen.
#/usr/bin/mysql_install_db

Damit wird eine neue struckture in /var/db/mysql/mysql angelegt.

4. Nach dem erstellen der neuen db ist es michtig das die erstellten daten
dem mysql user gehören, also machen wir ein

#chown -R mysql:mysql /var/db/mysql/mysql

5. So nun sollte der mysql server neu gestartet werden und danach hat mann
wider follen zugriff auf die mysql db mit null password.


6.

#mysql -uroot mysql

somit ist es nun auch wieder möglich ein dump der mysql db
mit den user rechten zu importiren.



Gruss Rabadag
 
Falls nur das Passwort verloren gegangen ist, sollte auch Folgendes helfen:
Code:
[url]http://dev.mysql.com/doc/mysql/en/Resetting_permissions.html[/url]
In a Unix environment, the procedure for resetting the root password is as follows:

   1. Log on to your system as either the Unix root user or as the same user that the mysqld server runs as.
   2. Locate the `.pid' file that contains the server's process ID. The exact location and name of this file depend on your distribution, hostname, and configuration. Common locations are `/var/lib/mysql/', `/var/run/mysqld/', and `/usr/local/mysql/data/'. Generally, the filename has the extension of `.pid' and begins with either `mysqld' or your system's hostname. Now you can stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the pathname of the `.pid' file in the following command:

shell> kill `cat /mysql-data-directory/host_name.pid`

      Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command.
   3. Restart the MySQL server with the special --skip-grant-tables option:

shell> mysqld_safe --skip-grant-tables &

   4. Set a new password for the root@localhost MySQL account:

shell> mysqladmin -u root flush-privileges password "newpwd"

      Replace ``newpwd'' with the actual root password that you want to use.
   5. You should now be able to connect using the new password. 

Alternatively, on any platform, you can set the new password using the mysql client:

   1. Stop mysqld and restart it with the --skip-grant-tables option as described earlier.
   2. Connect to the mysqld server with this command:

shell> mysql -u root

   3. Issue the following statements in the mysql client:

mysql> UPDATE mysql.user SET Password=PASSWORD('newpwd')
    ->                   WHERE User='root';
mysql> FLUSH PRIVILEGES;

      Replace ``newpwd'' with the actual root password that you want to use.
   4. You should now be able to connect using the new password.
 
Ja klar das ist ne möglichkeit sovern die daten in der mysql noch vorhanden sind.

Bei meinem fall war nichts mehr in den tabellen, keine user keine berechtigungen.
 
Zurück
Oben