Skip to main content
Known Participant
April 13, 2013
Question

Why can't i connect to mysql?

  • April 13, 2013
  • 2 replies
  • 2634 views

Ive been trying for two days now to connect to mysql in Dreamweaver but when i enter all my details into the 'mysql connection' dialog box and press test or if i try to select a database i keep getting an alert message saying " An unidentified error has occurred" What have i done wrong???

Appreciate any help!!

This topic has been closed for replies.

2 replies

Participant
November 8, 2013

Go to your File Manager on your server and look for the the folder _mmServerScripts. Delete it. Then reload your website in any webbrowser (it will re-create the folder). Now try connecting to your database.

David_Powers
Inspiring
April 13, 2013

Moved to the Develop server-side applications in Dreamweaver forum.

Is the MySQL server running?

Have you defined the site correctly?

Known Participant
April 14, 2013

Well the mysql server has been set up via my server host in phpmyadmin so i believe it should always be running. The site is setup to my server host and tells me it has connected successfully. If i go to my website (www.milesfunerals.com/donations_2.php) and put in a search which searches the database, it brings up a page to say "no databased selected" but my database panel in Dreamweaver there is a database present but there are no tables, although i know there are as i exported the database from the local site phpmyadmin and imported it into the remote site phpmyadim . I try double clicking the database (milesdata) in Dreamweaver which shows in the database panel, which then brings up the mysql connection dialog box and try to enter details again and search for the database again and thats when it comes up with "unidentified error has occurred" but i dont no why or how to correct it. I am new to Dreamweaver so i could well have done something wrong when trying to transfer everything from my testing server to remote server.

David_Powers
Inspiring
April 14, 2013

You appear to have a couple of different, albeit related problems.

One problem appears to be that you're trying to access your remote database within Dreamweaver. Most hosting companies prevent remote access to a database for security reasons. Although you can use a remote database as your testing server, it's not recommended.

The other problem is that when you click the Search button in your donations_2.php page, you get the message "No database selected". That indicates that the file in the Connections folder doesn't have the correct database details. The connection script (in the Connections folder) should contain something like this:

$hostname_connAdmin = "localhost";

$database_connAdmin = "mydatabase";

$username_connAdmin = "admin";

$password_connAdmin = "secret";

On most hosting companies, "localhost" is the correct value for hostname. You need to check that the name of the database is correct.

Setting up this type of connection can be difficult if you don't have experience with PHP/MySQL. The best way to do it is to use the same setup locally as on your remote server. For example, give your local version of the database the same name and structure as the remote version. Also use the same username and password.

You should also be aware that Dreamweaver's server behaviors are being withdrawn because they use outdated code that will eventually stop working. You're safe for the time being, but you will eventually need to replace the PHP code generated by Dreamweaver with more up-to-date code.