HighDots Forums  

Connecting to MySQL

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Connecting to MySQL in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AndrewJW1313
 
Posts: n/a

Default Connecting to MySQL - 05-02-2005 , 12:13 AM






I recently purchased Dreamweaver MX 2004 with ASP, Coldfusion, and PHP by
Jeffrey Bardzell. The book has been very helpful up to this point, but I am at
a chapter that requires the use of MySQL. I have installed MySQL and it is
running properly. I have also set up a local Apache server and PHP. All of the
dynamic content I have created and tested on my PC has been working fine, but
when I try to connect to MySQL using the Database window in Dreamweaver, I
receive a pop up window with the message: "An unidentified error has occured."
I have tried over and over and have double checked all of my input info. I
still receive the error message. I am using MySQL 4.0.14 as that is the version
used by the author of the book. Also, I am using Dreamweaver MX as apposed to
the latest version of MX 2004. Can anyone offer any ideas as to why I am unable
to connect to MySQL through Dreamweaver? Thank you for any and all responses.

Andrew


Reply With Quote
  #2  
Old   
David Powers
 
Posts: n/a

Default Re: Connecting to MySQL - 05-02-2005 , 04:04 AM






AndrewJW1313 wrote:
Quote:
when I try to connect to MySQL using the Database window in Dreamweaver, I
receive a pop up window with the message: "An unidentified error has occured."
http://www.macromedia.com/go/tn_16515

--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
http://computerbookshelf.com


Reply With Quote
  #3  
Old   
AndrewJW1313
 
Posts: n/a

Default Re: Connecting to MySQL - 05-02-2005 , 08:49 PM



Thank you, David, for you response. I followed all of the solutions, except the one marked "not recommended," and I am still having no luck. Is there anything else I can try?

Thank you,
Andrew

Reply With Quote
  #4  
Old   
David Powers
 
Posts: n/a

Default Re: Connecting to MySQL - 05-03-2005 , 06:09 AM



AndrewJW1313 wrote:
Quote:
Thank you, David, for you response. I followed all of the solutions, except the one marked "not recommended," and I am still having no luck. Is there anything else I can try?
You don't say what operating system you're using, but sometimes on a Mac
Dreamweaver fails to resolve localhost correctly. In the site
definition, try replacing all instances of "localhost" with "127.0.0.1"
(without the quotes).

Also, make sure there is a trailing slash on the URL prefix in your site
defininition.

I don't have a copy of Jeffrey Bardzell's book, but I presume he has
given you instructions how to set up the root password and create user
accounts in MySQL. You should also remove anonymous access, which can
cause problems with logging on. Open MySQL monitor (mysql -u root -p),
and type the following commands:

use mysql;
DELETE FROM user WHERE user = '';
FLUSH PRIVILEGES;
exit;

Other than that, a properly set-up version of MySQL and Dreamweaver
should work in perfect harmony.

--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
http://computerbookshelf.com


Reply With Quote
  #5  
Old   
AndrewJW1313
 
Posts: n/a

Default Re: Connecting to MySQL - 05-03-2005 , 04:21 PM



David,

I'm running Windows XP Home Edition -- does that make a difference how I enter
the information into the MySQL monitor? Also, the book does not provide
instructions for creating user names, passwords or user accounts. It pretty
much says to install MySQL with all of the defaults and when you are trying to
connect to to the datbase through DW, enter "root" as the username and leave
the password blank, but this does not work. I will try your other suggestion,
but if you could, please tell me how to set up my username/password/user
accounts in MySQL.

Thank you,
Andrew

Andrew


Reply With Quote
  #6  
Old   
David Powers
 
Posts: n/a

Default Re: Connecting to MySQL - 05-03-2005 , 06:14 PM



AndrewJW1313 wrote:
Quote:
I'm running Windows XP Home Edition -- does that make a difference how I enter
the information into the MySQL monitor?
No. MySQL monitor works exactly the same on all operating systems.

Quote:
Also, the book does not provide
instructions for creating user names, passwords or user accounts. It pretty
much says to install MySQL with all of the defaults and when you are trying to
connect to to the datbase through DW, enter "root" as the username and leave
the password blank,
That is appalling. If you're going to be able to use PHP and a MySQL
database on your hosting company, you need to know how to set up user
accounts, permissions and passwords.

Quote:
but if you could, please tell me how to set up my username/password/user
accounts in MySQL.
Since you have been given no instructions, I presume you can open MySQL
monitor with just the following:

mysql -u root

If so, once you get in, type the following commands (all followed by Enter):

use mysql;
UPDATE user SET password = PASSWORD('my_password') WHERE user = 'root';
DELETE FROM user WHERE user = '';
GRANT SELECT, INSERT, DELETE, UPDATE ON *.* TO dbadmin@localhost
IDENTIFIED BY 'my_admin_password';
FLUSH PRIVILEGES;
exit;

That will set up a password for the root user (use your own password
instead of my_password). It will also set up an administrative user
called dbadmin (again, substitute your own password for
my_admin_password. Make sure you use quotes in the same places that I
have. Also make sure you use the semicolon - that tells MySQL that you
have finished entering a command.

Test both usernames and passwords by opening MySQL monitor.

mysql -u root -p

You will be prompted this time for a password. Use the root password.
Once you're in, just type exit and press Enter. Then try to get back in
as dbadmin:

mysql -u dbadmin -p

Again you'll be asked for the dbadmin password.

When connecting from Dreamweaver, use the dbadmin username and password.

I hope the book shows you how to set up a database and some tables.

--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
http://computerbookshelf.com


Reply With Quote
  #7  
Old   
AndrewJW1313
 
Posts: n/a

Default Re: Connecting to MySQL - 05-03-2005 , 08:03 PM



David,

Thank you for your help, I'm am going to the nearest Barnes & Noble and buying
your books I am now able to connect to the MySQL server, but I now I'm
getting a new error message in DW;

"1) There is no testing server running on the server machine.
2) The testing server specified for this site does not map to the
http://localhost/newland/_mmServerScripts/MMHTTPDB.php URL. Verify that the URL
Prefix maps to the root of the site."

I set up my site definition according to the book and I don't see anything in
the Site>Edit Sites dialog window that looks incorrect. What should I be
looking for?

Thank you, again,
Andrew


Reply With Quote
  #8  
Old   
David Powers
 
Posts: n/a

Default Re: Connecting to MySQL - 05-04-2005 , 03:18 AM



AndrewJW1313 wrote:
Quote:
I am now able to connect to the MySQL server, but I now I'm
getting a new error message in DW;

"1) There is no testing server running on the server machine.
2) The testing server specified for this site does not map to the
http://localhost/newland/_mmServerScripts/MMHTTPDB.php URL. Verify that the URL
Prefix maps to the root of the site."
In the Site Definition dialog box, click the Advanced tab, and select
Testing Server. Make sure that you have the following settings:

Server model: PHP MySQL
Access: Local/Network
Testing server folder: (use the folder icon to navigate to the right folder)
URL prefix: http://localhost/sitename/

The URL prefix is determined by the name of the folder where you keep
your site in the Apache DocumentRoot. Unless you made changes to the
Apache configuration file, the DocumentRoot will be C:\Program
Files\Apache Group\Apache2\htdocs. So, if your site is in a subfolder of
htdocs called "mysite", the URL prefix will be:

http://locahohost/mysite/

The trailing slash on the URL prefix is very important.

Hopefully, that should now set you on your way.

--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
http://computerbookshelf.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.