Page 1 of 1
Setup connection in Dreamweaver to MySQL
Posted: Sun Apr 16, 2006 11:09 pm
by hanxiao
Version:
MySQl 5.0
PHP 5.12
Apache 2.055
Dreamweaver MX 2004
Windows XP+SP2
I got a problem when I try to set up a connection to MySQL database in Dreamweaver. Apache server is fine, PHP is also fine. I can see my php page via the browser under Dreamweaver. I can also login MySQL database under command line. But when I try to set up a connection to MySQl in Dreamweaver, it gives me a error when I try to select the database "An unidentifed error has occurred". I have followed the instruction on the web to modify the php.ini and httpd.conf files. I don't know what did I missed.
For MySQL login in Dreamweaver:
MySQL server : localhost
User name : root
Password : ******** (correct)
Database: php
Anyone has any idea about my problem?
Thank you very much.
Posted: Sun Apr 16, 2006 11:19 pm
by John Cartwright
from the install intruction on
http://ca.php.net/mysql
Installation on Linux Systems
PHP 5+
MySQL is not enabled by default, nor is the MySQL library bundled with PHP. Read this FAQ for details on why. Use the --with-mysql[=DIR] configure option to include MySQL support. You can download headers and libraries from MySQL.
Installation on Windows Systems
PHP 5+
MySQL is no longer enabled by default, so the php_mysql.dll DLL must be enabled inside of php.ini. Also, PHP needs access to the MySQL client library. A file named libmysql.dll is included in the Windows PHP distribution and in order for PHP to talk to MySQL this file needs to be available to the Windows systems PATH. See the FAQ titled "How do I add my PHP directory to the PATH on Windows" for information on how to do this. Although copying libmysql.dll to the Windows system directory also works (because the system directory is by default in the system's PATH), it's not recommended.
As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext
Note: If when starting the web server an error similar to the following occurs: "Unable to load dynamic library './php_mysql.dll'", this is because php_mysql.dll and/or libmysql.dll cannot be found by the system.
Have you read this before?
Moved to Web Servers.
Posted: Sun Apr 16, 2006 11:47 pm
by hanxiao
I haven't read that page yet.
But I just tried to use MySQL-Front to connect to my MySQL database, it works like SQL Server. Easy and Simple.
But I still want to set up a database connection directly in Dreamweaver, so I don't need to open another programme to read the database details.
Posted: Mon Apr 17, 2006 8:48 am
by hanxiao
Thank you very much.
I think I found the problems. But I am not sure which one is the vital one.
I did some changes in the setting files:
In httpd.conf, I added this line, which was in the php.ini file, which I followed the instruction on
http://www.php.net, maybe it's my misunderstanding from the instruction, but I think it is really misleading me to do the wrong thing:
PHPIniDir "D:/PHP/php-5.1.2-Win32"
In php.ini, I added one more line for the extension, which was not in the recommended php.ini file.
extension=php_mysqli.dll
I also replaced the libmysql.dll file which was contained within the zip file of 5.0.18 version PHP from the
http://www.php.net with the new file from
http://dev.mysql.com/downloads/connector/php/
They have different size, so I am confused is it a mistake from php or it is just because mysql updated the dll file?
But everything is working, thank you.
If anyone has similiar problem with setting up extensions etc. can go to read this thread:
http://forums.mysql.com/read.php?52,698 ... #msg-69846
It's really useful.
Posted: Mon Apr 17, 2006 8:53 am
by John Cartwright
PHP5 by default does not load the extension, that why is you are supposed to add it to your php.ini
glad you got it working, enjoy

Posted: Sat Apr 22, 2006 6:24 am
by hanxiao
Is there anyone having idea about different file size of libmysql.dll file?
The original from the php .zip file package is smaller than the one from mysql website. I don't understand why.
Anyone knows?