PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : MySQL will als root ausgeführt werden?



robotangel
24.07.04, 15:03
Hallo Leute,

Bei all den folgenden Sachen habe ich mich auch mal grafisch als root eingelogggt, weil man ja eigentlich alles als root machen muss.

ich habe nun einen Apache 1.3.31 mit php5 fest einkompiliert. Vorher aber MySQL mit

./configure --with-server-suffix --with-pthread --prefix=/www/mysql

(dann natürlich make && make install)
(habe eine SuSE Linux 9.0)

/www/mysql habe ich vorher angelegt. Dann habe ich in der PHP Configure --with-mysql=/www/mysql eingetragen. Und PHP und Apache den freien Lauf gelassen. phpinfo(), alles funktioniert, alle Pfade auch zu MySQL passen.

So /www/bin/apachectl stop.

So, wie starte ich 'nen MySQL Server?

linux:/ # mysqld
Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
040724 14:32:37 Aborting

040724 14:32:37 mysqld: Shutdown Complete

linux:/ # /www/mysql/bin/safe_mysqld
bash: /www/mysql/bin/safe_mysqld: Datei oder Verzeichnis nicht gefunden
linux:/ # /www/mysql/bin/mysqld_safe
Starting mysqld daemon with databases from /www/mysql/var
040724 14:33:03 mysqld ended

linux:/ # mysqlserver
bash: mysqlserver: command not found
linux:/ # mysql -u root
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
linux:/ # mysqld -u root
040724 14:39:48 Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist
040724 14:39:48 Aborting

040724 14:39:48 mysqld: Shutdown Complete

linux:/ # mysql -u root mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
linux:/ # mysql -u mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
linux:/ # mysql -u root -p
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
linux:/ # mysql -u root -p
Enter password:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
linux:/ # mysqld
Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
040724 14:49:28 Aborting

040724 14:49:28 mysqld: Shutdown Complete

linux:/ #

Ein paar Sachen habe ich auch einfach aus Verzweiflung probiert.

Was soll ich jetz tun? Bin so ziemlich Verzweifelt, danke!!

$kuLL
24.07.04, 17:07
Den mysqld sollte man nicht als root starten, deshalb die Meldung.
Starte ihn mit

mysqld --user=mysql
Der User muss natürlich existieren.

robotangel
24.07.04, 19:26
Soviel Tutorial lese ich dann auch noch ;)

thx, werds gleich mal probieren!!

robotangel
25.07.04, 11:25
linux:/www/mysql/bin # ./mysql_install_db && cd /www/mysql ; /www/mysql/bin/mysqld_safe &
Installing all prepared tables
010101 0:30:21 /www/mysql/libexec/mysqld: Shutdown Complete


To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/www/mysql/bin/mysqladmin -u root password 'new-password'
/www/mysql/bin/mysqladmin -u root -h linux password 'new-password'
See the manual for more instructions.

NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /www/mysql/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

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

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /www/mysql/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 https://order.mysql.com

linux:/www/mysql/bin # cd /www/mysql ; /www/mysql/bin/mysqld_safe &
[1] 2703
linux:/www/mysql # Starting mysqld daemon with databases from /www/mysql/var
010101 00:38:58 mysqld ended


[1]+ Done /www/mysql/bin/mysqld_safe
linux:/www/mysql #


--------------------------

Ist das jetzt gestartet (Done)? Oder nicht (mysqld ended)? Müsst ich jetzt irgendwie wissen... PHP meint in meinem Skript:

Fehler beim Aufbauen der Verbindung zu MySQL: Lost connection to MySQL server during query

hä? THX for any help.

$kuLL
25.07.04, 17:42
Such bitte im Forum oder über Google.
Das Thema wurde schon soooo oft behandelt.

Es gibt unzählige Schritt für Schritt Anleitungen im Netz, mit denen man nix falsch machen kann.

Aber mal 5 min zu suchen ist ja für manche schon zu viel.

Alleine schon die Doku von MySQL ist genial: http://dev.mysql.com/doc/mysql/de/Post-installation.html

robotangel
26.07.04, 14:39
Na ja, hab eigentlich schon gesucht... Nur aber zu meinem Problem und nicht, wie ich das völlig neu mache...

Nungut, dann nicht :p