can't connect to mysql database
| From: | Olaf Selke | Date: | Sat, 24 Feb 2001 07:59:02 +0000 |
| Subject: | can't connect to mysql database | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-2200@lists.php.net to get a copy of this message | ||
hi list,
I'm new to this list and I maybe I'm asking some dumb question already
answered a hundred times. At least I've consulted deja.com in
vain. Platform is Sun Solaris 2.6, Apache 1.3.14, and
php-4.0.4pl1. I've build Apache and the php module according the php
INSTALL file. I decided for the static module and everything went
smoothly without any compilation errors.
However, it looks like the php module can't connect to the mysql database. The
script falo.php:
<?php
$link = mysql_connect ("localhost:3306", "root",
PASSWORD")
or die ("Could not connect");
print ("Connected successfully");
mysql_close ($link);
?>
always returns a
Warning: MySQL Connection Failed: Can't initialize character set 12 (path: default) in
/usr/local/apache/hosts/www.blutmagie.de/data/tools/myphpadmin/falo.php on line 2
Could not connect
The mysql database can be accessed on the same machine from cli without
any problems:
root@www [/usr/local/apache/hosts/www.blutmagie.de/data/tools/myphpadmin] >>mysql -uroot
-pPASSWORD
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 111 to server version: 3.23.23-beta
Type 'help;' or '\h' for help.
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| sympoll |
| test |
+----------+
3 rows in set (0.01 sec)
What am I missing or what's going wrong here and how can I fix it?
You can access my php script directly from
http://www.blutmagie.de/tools/myphpadmin/falo.php
Olaf
--
Olaf Selke, Olaf.Selke@mediaWays.net, voice +49 5246 80-1169