• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

openSUSE 11 MySQL root und Passwort

tomma

Member
Hallo,
mit LAMP bin ich nicht ganz unerfahren, habe einige MySQL-Server mit SUSE10 zu laufen, aber:
Ich habe hier ein Phänomen, welches ich nicht erklären kann:
1. openSUSE 11-Installation (ganz frisch)
2. alle LAMP-Programme installiert
3. MySQL gestartet, eigenartige Fehlermeldung (leider nicht in Erinnerung, welche), dass der Start nicht möglich ist.
4. Versuch Nr. 2 zum Start, diesmal werden die Benutzertabellen ordnetlich angelegt.
5. Konsole: mysql -u root <ENTER> Antwort: Access denied for user 'root'@'localhost' (using password: NO)
(Ich habe GANZ SICHER kein Passwort deklariert)
6. Konsole: mysql -u root -p (Passwort wird abgefragt, welches ich nicht kenne
7. Alle Tricks, den SQL-Server mit NULL Sicherheit laufen zu lassen (Parameter in der my.cnf setzen) funktionieren zwar erstmal, aber ohne Rechte kann man keine Datenbank anlegen, ein Setzen des root-Passworts wird zwar scheinbar ausgeführt, schlägt aber fehl, wenn man den Server wieder mit Sicherheit startet.
Selbst die Installation eines anderen MySQL-rpm (SLES-Server 9) installiert zwar den MySQL-Server, aber das Problem bleibt erhalten. Ich vermute, es wird gar kein root-Account erzeugt.
(Ich bin so ein bisschen auf die SUSE 11 angewiesen, weil ich einen Open XChange-Server installieren will.)
Ich denke immer, MySQL ist doch eine Standardanwendung und alle openSUSE11-LAMP-Leute müssten das gleiche Problem haben ...
By(e) Tomma
 

Dr. Glastonbury

Advanced Hacker
Tut mir leid,
leider keine Antwort von mir... ich mach hier nur sauber... *wischschsch*

-> ab ins Datenbankforum, da ist das wohl besser aufgehoben ;)
 
OP
T

tomma

Member
Natürlich nicht gelöst ...
Aber:
- Der Fehler trat nur auf einem bestimmten PC auf (nach 3 Installationsversuchen!)
- ein anderer PC mit SUSE 11 arbeitet bzgl. MySQL einwandfrei
- o.g. "schlechter" PC: SUSE 11.1.Beta5 genommen, MySQL-Fehler tritt nicht mehr auf.
Also wie immer:
Die Wege des Herrn sind unergründlich.
By(e) Tomma
 

UranusI

Newbie
habe das gleiche Problem ...mit 2 PCs einmal 64 Bit und einmal 32 Bit
habe eigentlich Erfahrung mit 10.0 und mysql. Da gibt es kein mysql password in der Initialphase. Nun dachte ich da ist irgendwie eins irgednwie drinn. Man kann ja das Password zurücksetzen.

service mysql stop Server stoppen

ind die /etc/init.d/mysql folgendes nachtragen
$SAFE_MYSQLD \
.
.
--skip-grant-tables \
--skip-networking \

dann

service mysql start (ohne password)

mysql -u root (also root einklinken ohne password)
mysql> use mysql; (Tabelle auswählen)
mysql> UPDATE user SET Password=PASSWORD("NewPassword") WHERE User="root";
Query OK, 1 row affected (0.03 sec)
Rows matched: 1 Changed: 1 Warnings: 0 (Password neu setzen)

soo und da habe ich schon

0 rows affected ...rows matched:0 Changed:0

das heisst der hat in die "Luft" gegriffen

Fazit: wie komme ich "normal" als root in die Datenbank?

Danke
 

panamajo

Guru
Alle MySQL Pakete entfernen.
Verzeichnis /var/lib/mysql und Datei /etc/my.cnf löschen
MySQL Pakete neu installieren.
Falls beim 1. Start Fehlermeldungen kommen diese speichern.
 

UranusI

Newbie
habe deinstalliert und Verzeichnis /var/lib/mysql und Datei /etc/my.cnf gelöscht,

dann neu installiert

dann rcmysql start
Error:1062 Duplicate entry 'localhost-' for key 1
dann abruch

trotzdem gehts weiter

Creating Mysql privilege database
installing MySQL system tables
Installation of systemtables failed!

nun kommen die Tipps mit --skip-grant &

hier ist doch in dem installationsscript schon was falsch
 

whois

Ultimate Guru
Ist das die MySQL Version von der 11.1 DVD?
Mit der hatte ich auch einige Probleme.

Deshalb habe ich die wieder runter geworfen.
 

whois

Ultimate Guru
Hi

Code:
Fehler: 1062 SQLSTATE: 23000 (ER_DUP_ENTRY)

Meldung: Doppelter Eintrag '%s' für Schlüssel %d

Da muss schon ein Schlüssel mit gleichen Eintrag vorhanden sein.

http://dev.mysql.com/doc/refman/5.1/de/error-messages-server.html

cu
 

UranusI

Newbie
wo muss schon ein Schlüssel mit doppeltem Eintrag vorhanden sein? ...
Sorry habe nix verstanden. Bringe mein Problem nicht mit dem zusammen?
 

UranusI

Newbie
habe mich nun wieder dafür Zeit gefunden. Habe Mysql installiert (völlig Neu)
dan start vo mysql (und gleich gehts los)

localhost:/var/lib/mysql # rcmysql start
Creating MySQL privilege database...
Installing MySQL system tables...
ERROR: 1062 Duplicate entry 'localhost-' for key 1
090223 19:52:09 [ERROR] Aborting

090223 19:52:09 [Note] /usr/sbin/mysqld: Shutdown complete

Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/sbin/mysqld --skip-grant &
and use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!
failed

dann bin ich mal so stur und beherzige die Tips
Tipp 1)

Examine the logs in /var/lib/mysql for more information.

da finde ich nur zwei Ordner mysql und test (also die beiden Datenbanken)

Tiip 2)

localhost:/etc # /usr/sbin/mysqld --skip-grant &
090223 19:57:23 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

090223 19:57:23 [ERROR] Aborting

090223 19:57:23 [Note] /usr/sbin/mysqld: Shutdown complete

[1] 16750
[1]+ Exit 1 /usr/sbin/mysqld --skip-grant

sollte ich mysql nicht von suse runterladen?
 

UranusI

Newbie
Creating MySQL privilege database...
Installing MySQL system tables...
OK
Filling help tables...
OK
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h saturn password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Updating MySQL privilege database...
Looking for 'mysql' in: /usr/bin/mysql
Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
Running 'mysqlcheck'...
mysql.columns_priv OK
mysql.db OK
mysql.func OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.proc OK
mysql.procs_priv OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Running 'mysql_fix_privilege_tables'...
OK
Starting service MySQL done

sooo und wieso? wo war der Hacken?

mysql_install_db sets up the GRANT table and tries to add some users. specifically ‘root’at’localhost’ and ‘root’at’<hostname>’. If the hostname of the machine is accidentally set to ‘hostname’ or ‘localhost’, it results in a duplicate entry.

Lösung

hostname whateveryouwant


das muss einem doch gesagt werden ...... :???:
 

panamajo

Guru
UranusI schrieb:
If the hostname of the machine is accidentally set to ‘hostname’ or ‘localhost’, it results in a duplicate entry.
Wer nennt seinen Rechner auch localhost (reservierter Name) oder hostname (dämliche Wahl)?

Aber trotzdem Danke für deine Hartnäckigkeit, denn das Problem kam öfters und war nicht reproduzierbar.
 

UranusI

Newbie
wer nennt ihn wohl so ..Novell ...das sind die Standardeinstellungen nach der Installation von openSuse ...
lies mal oben den ersten Eintrag ..alles völlig neu und so war es bei mir auch ..alles völlig neu.
 

panamajo

Guru
UranusI schrieb:
If the hostname of the machine is accidentally set to ‘hostname’ or ‘localhost’, it results in a duplicate entry.

Das reicht nicht, irgendwas muss noch falsch gewesen sein.

Wenn der Hostname "hostname" lautet bekomme ich zwar eine Fehlermeldung beim 1. MySQL Start (resolveip geht nicht) aber dann wird die DB mysql gar nicht angelegt, folglich keine Duplicates.
 

UranusI

Newbie
es war ja auch 'localhost' habe das extra noch 2x durchgespielt ..seitdem nie wieder den fehler gehabt --für mich ist es so reproduzierbar.
 

UranusI

Newbie
also ich kann nur davon ausgehen was ich hier hatte.
openSUSE 11.0 frisch installiert. Gleich die LAMP Server alle mit. Nach Installation und auto-update mit
/etc/init.d/mysql start begonnen.
Uns so ging das immer in die Hose. Interessant war, dass ich einfach (in der Frühphase meiner Versuche) das startskript einfach nochmal laufen lies - Da sah es schon besser aus. Aber sah nur so aus. Ja dann viele viel verzweifelten weitere ver- und suche :)
Bis dann das mit dem Hostnamen kam. Klingt auch logisch. Also in Saturn umbenannt und alles lief so wie es soll - sogar mein OX *gg*
 
Oben