Setup connection in Dreamweaver to MySQL

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
hanxiao
Forum Newbie
Posts: 12
Joined: Sun Apr 16, 2006 10:58 pm
Location: Auckland, New Zealand
Contact:

Setup connection in Dreamweaver to MySQL

Post 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.
Last edited by hanxiao on Mon Apr 17, 2006 6:18 am, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
hanxiao
Forum Newbie
Posts: 12
Joined: Sun Apr 16, 2006 10:58 pm
Location: Auckland, New Zealand
Contact:

Post 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.
hanxiao
Forum Newbie
Posts: 12
Joined: Sun Apr 16, 2006 10:58 pm
Location: Auckland, New Zealand
Contact:

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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 :P
hanxiao
Forum Newbie
Posts: 12
Joined: Sun Apr 16, 2006 10:58 pm
Location: Auckland, New Zealand
Contact:

Post 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?
Post Reply