Re: mysql mit php: kein connect
Hallo Janto,
* Janto Trappe <janto@sylence.de> [21-02-02 00:40]:
> Hi,
>
> ich habe gerade mysql installiert und schon das erste Problem: Auf
> der Konsole funktioniert alles wie erwartet, ueber php kann ich aber
> nicht mal eine Verbindung zum Server aufbauen.
>
> Ein einfaches Skript
>
> | <?php
> | $db =3D @mysql_connect("localhost","root","password");
^^
Ist das Original? Ich hab das Ganze ohne 3D und @ am laufen und es
funktioniert. Wie heißt die Datei? .php oder .html? Bei mir läuft's
nur mit .php.
Funktioniert denn echo phpversion(); ?
> | if ($db) {
> | echo "Connect! $db";
> | } else {
> | echo "Error!";
> | }
> | @mysql_close($db);
> | ?>
>
> liefert mir nur '<html><body></body></html>'.
>
> In der httpd.conf wird das auth_mysql und das php4 Modul geladen. In der
> mysql.err steht:
auth brauchst du nicht unbedingt.
> | 020220 22:24:51 mysqld started
> | 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 for example,
> | innodb_data_file_path =3D ibdata1:30M
> | 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/sbin/mysqld: ready for connections
Hat nicht viel zu sagen, steht bei mir auch. Ist nicht auf dein
Problem bezogen.
> php ohne mysql funktioniert problemlos.
>
> Config: Apache, php4 und mysql aus woody, frisch installiert.
>
> Kann mir jemand sagen was ich falsche mache? Bei Bedarf schicke ich
> euch natuerlich auch Config-Auszuege. Danke!
Versuch's mal ohne @-Zeichen.
HTH
Gruss Udo
--
ComputerService Müller | You want my PGP-Key? | Key: 0xAD0EEC22
Kaspersweg 11a | mail -s "get pgp-key" | Tel: 0441-36167578
26131 Oldenburg | Schon fit für € und ¢? | Mobil: 0162-4365411
Registrierter Linux-User #225706 auf Debian GNU/Linux 2.4.17
Reply to: