PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : mysql - externer zugriff



morpheus2001
04.05.04, 16:16
hi,

ich will für auf meine lokalen sql datenbanken extern zugreifen.
nur wie?

Ich habe folgendes bereits erledigt:

- host umgeändert von "localhost" in "%" in den entsprechenden db.

jo das wars eigentlich auch schon. meine my.cnf sieht folgendermaßen aus:

-------------------------------------------------------------------
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
---------------------------------------------------------------------------

Folgende Fehlermeldung ist mit aufgefallen:
-------------------------------------------------------------------
Number of processes running now: 1
mysqld process hanging, pid 25383 - killed
040504 17:17:07 mysqld restarted
Cannot initialize InnoDB as 'innodb_data_file_path' is not set.
If you do not want to use transactional InnoDB tables, add a line
skip-innodb
to the [mysqld] section of init parameters in your my.cnf
or my.ini. If you want to use InnoDB tables, add to the [mysqld]
section, for example,
innodb_data_file_path = ibdata1:10M:autoextend
But to get good performance you should adjust for your hardware
the InnoDB startup options listed in section 2 at
http://www.innodb.com/ibman.html
/usr/libexec/mysqld: ready for connections
---------------------------------------------------------------------------

morpheus2001
04.05.04, 16:27
wenn ich die variable innodb_data_file_path = ibdata1:10M:autoextend setzte bekomme ich folgende meldung in den logfiles:
---------------------------------------------------------------------------
Number of processes running now: 1
mysqld process hanging, pid 12331 - killed
040504 17:24:38 mysqld restarted
040504 17:24:38 InnoDB: Out of memory in additional memory pool.
InnoDB: InnoDB will start allocating memory from the OS.
InnoDB: You may get better performance if you configure a bigger
InnoDB: value in the MySQL my.cnf file for
InnoDB: innodb_additional_mem_pool_size.
040504 17:24:38 InnoDB: Database was not shut down normally.
InnoDB: Starting recovery from log files...
InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 43892
InnoDB: Doing recovery: scanned up to log sequence number 0 43892
040504 17:24:38 InnoDB: Flushing modified pages from the buffer pool...
040504 17:24:38 InnoDB: Started
/usr/libexec/mysqld: ready for connections
---------------------------------------------------------------------------

morpheus2001
04.05.04, 16:36
nächste erkenntnis: ich habe jetzt innodb geskipt.
meine my.cnf sieht jetzt folgendermaßen aus:


-------------------------------------------------------------------
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-innodb

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
--------------------------------------------------------------------

Frage 1: Für was brauche ich innoDB ?
Frage 2: Wieso kann ich immer noch keine externe Verbindung aufbauen?

Logdatei sagt nur:

------------------------------------------
Number of processes running now: 1
mysqld process hanging, pid 12598 - killed
040504 17:30:08 mysqld restarted
/usr/libexec/mysqld: ready for connections
------------------------------------------

Gruß

Harry
04.05.04, 19:00
Du benötigst einen Privilegien-Eintrag für Deine DB in der Datenbank "mysql". Den erzeugst Du nach dem Einloggen in der Datenbank mit dem Kommando GRANT -> "GRANT <Privilegien > on <DB>[.<Tabelle>] to <User>@<Host> IDENTIFIED BY '<Passwort>'".

Die genaue Syntax zu dem Kommando solltest Du Dir unbedingt in der Dokumentation zu MySQL anschauen.

Harry

morpheus2001
05.05.04, 13:31
GRANT ALL PRIVILEGES ON * . * TO "root"@"%"IDENTIFIED BY "**********"WITH GRANT OPTION ;

Folgende Fehlermeldung wenn ich per PHP Script eine Verbindung aufbauen will:


Warning: Lost connection to MySQL server during query in /usr/phplib/mysql.o.php on line 21

Warning: MySQL Connection Failed: Lost connection to MySQL server during query in /usr/phplib/mysql.o.php on line 21
Lost connection to MySQL server during query

Bitte um hilfe :(
Gruß
Daniel

Harry
05.05.04, 13:52
Das schaut so aus, als würde Dein DB-Server netzwerkmäßig runterfallen. Das hat also nichts mit den Privilegien zu tun.
Möglicherweise hast Du Dein MySQL schon "kaputt"konfiguriert ;)

Das einfachste wäre, Du beginnst nochmal mit einer komplett neuen MySQL-Installation.

Harry

morpheus2001
06.05.04, 16:11
hi,

ok ich hab jetzt SQL neu installiert. komplett alles neu installiert.
der selbe fehler....

Folgende Einträge stehen in der mysql Table:

INSERT INTO `db` VALUES ('fileserver', 'K2LUSER', 'root', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N');
INSERT INTO `db` VALUES ('fileserver', 'k2l_azeit', 'azeitmanager', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N');


Folgende in der user Table:

INSERT INTO `user` VALUES ('fileserver', 'azeitmanager', '5777b47c7b13d5bd', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N');
INSERT INTO `user` VALUES ('fileserver', 'root', '4b9360d26321e4b9', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

Folgendes steht in der my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


Folgendes erscheint beim Versuch, mich zu Verbdinung und die Table K2LUSER als root zu erreichen:

Number of processes running now: 1
mysqld process hanging, pid 16496 - killed
040506 17:02:12 mysqld restarted
/usr/libexec/mysqld: ready for connections

Hoffe mir kann jemand helfen.

Grüße Daniel

Harry
06.05.04, 16:31
Hi Daniel,

da weiss ich im Moment auch keine konkrete Lösung.
Vielleicht ist Deine MySQL-Version einfach buggy. Vielleicht hast Du auch einen Defekt auf dem Filesystem oder Datenträger. Vielleicht ist Dein IP-Stack auch hinüber. Vielleicht hast Du auch einfach die falschen Kommandos eingegeben. Es kann an tausend Dingen liegen :(

In den Logfiles finden sich keine konkreteren Hinweise?

Harry

PS: Auf die DB "mysql" kommst Du problemlos?

morpheus2001
06.05.04, 16:42
keine konkreten hinweise.

ich benutze mysql version:
mysql-server-3.23.52-3

ich hab das direkt von der redhat 8.0 cd geholt und als rpm installiert.
denke das müsste doch enigermaßen stabil sein!?

logdateien zeigen nur dass mysql neustartet. sonst nix :mad:

ich verzweifle ...
in google und co. steht immer nur das selbe was ich auch gemacht habe.

bei einem Beitrag stand ich muss mein Server von Lokal auf Remote umstellen... soll ich das ernst nehmen?? Wenn ja ... gibt es denn die Möglichkeit bei mysql-server solche parameter anzugeben? Womöglich in der my.cnf??

Wobei das ganze ja eigentlich irrsinn ist, weil die Verbindung zum DB Server steht ja, sonst würde er nichts in die Logdateien schreiben :confused:

Hilfe! :(

Figapu
06.05.04, 17:01
Wenn du Benutzerprobleme mit MySQL hast, hilft eine neuinstallation in der Regel nichts da die Datenbanken nicht unbedingt mit gelöscht wurden.

Füre als root mal mysql_install_db aus. Danach musst du noch die Datenbanken dem entsprechenden Nutzer aneignen, also sowas ala "chown -R mysql.mysql /var/lib/mysql".

Danach kannst du dir nen Nutzer so bearbeiten:


root@StarFox:/home/users/figapu# mysql -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 65 to server version: 4.0.18

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> UPDATE user
-> SET Host = "%"
-> WHERE User = "root";
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)


Gibt auch noch spezielle MySQL Befehle dafür, aber ich machs immer so ;)

HTH

Harry
06.05.04, 17:01
Eine Umstellung von lokal auf remote halte ich für ein wenig weit hergeholt - zumindestens kenne ich das bei MySQL nicht.

Kannst Du denn problemlos auf die Datenbank "mysql" zugreifen?

Harry

morpheus2001
06.05.04, 19:43
ich hab das problem denke ich gefunden.
es handelt sich tatsächlcih um ein bug in der mysql version 3.23.52-3.
ich werde jetzt die version updaten und morgen nocheinmal versuchen.

danke für die hilfe.
gruß
daniel

morpheus2001
07.05.04, 13:17
ok!
nächstes problem!

Wie update ich mein system von:

mysql-3.23.52-3 auf die neue SQL Version ohne
an der glibc herumzufuschen ???

:(