[thelist] Having trouble connect Dreqmweaver MX 2004 to MySQL server

Burhan Khalid thelist at meidomus.com
Tue Jul 27 11:03:58 CDT 2004


Rich Points wrote:

> Hi,
> I'm trying to get started with MySQL/PHP and Dreamweaver MX 2004 and I can't make a connection to my remote MySQL server.
   I've set up a database and connection in DW but when I try to test 
the connection it times out and no connection is made.

[ snipped ]

> Any ideas why I'm having this problem?

By default, MySQL only listens on "localhost", which means that the only 
connections accepted are those that originate from the same computer as 
the MySQL server.

To allow remote access, you must configure the MySQL server to listen on 
the external IP of the computer (and also, make sure port 3306 is open 
if you have any firewalls, etc.) The setting you are after is 
bind-address. It defaults to 127.0.0.1 (the local loopback address). You 
can find this setting in the my.cnf file, and edit it accordingly. Also 
make sure you restart the server.

The next thing you will need to do is create a user that has access to 
the server from a remote IP. The easiest way to do this is to login to 
the server as root (or administrator), then run:

mysql>GRANT ALL ON databasename.* TO `username`@'%' IDENTIFIED BY 
'password';

This will create a user (username) that has access to MySQL from any IP 
(that's the %) and has all permissions on databasename.

> 
> I think the problem may be with my PHP configuration on my local machine.   I've read that php facilitates the connection with the MySQL server. 

PHP is just one way to connect to MySQL. There are tons of other clients 
out there that you can use. The simplest one is the client that comes as 
part of MySQL ... namely the program 'mysql'.

You can test to see if your mysql server is running by executing:

mysql -u username -p

To test if PHP is running, create a file with <?php phpinfo(); ?>, give 
it a php extension, upload it to your web server's document root, and 
then browse to it. So if you called the file info.php, you would type 
http://www.mydomain.com/info.php (or if you are running the server on 
your local computer) http://localhost/info.php

Please configure your email client so that it breaks up your lines at 75 
characters. Your email in Thunderbird is one huge line, causing a large 
horizontal scrollbar.


More information about the thelist mailing list