English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have setup databases and usernames in MySql using phpMyAdmin. I then want to join the database to Dreamweaver. I have tried to add the database but i get this error message : "HTTP Error Code 401 Unauthorized".

I have tried the root account which I have configured not to have a password but I still get this error message. How do I get around this problem?

I have checked username, password why is this error occuring?

2007-05-12 22:06:52 · 6 answers · asked by Siu02rk 3 in Computers & Internet Programming & Design

I am using IIS as the webserver. PHP seems to be working correctly as I can test PHP pages on the local machine.

2007-05-12 22:31:58 · update #1

I am using PHP5isapi.dll which is registered in the application configuration in IIS.

2007-05-12 23:04:14 · update #2

6 answers

First of all, try to avoid using front ends such as DreamWeaver: they make the code a mess and are very hard to maintain. Write your code using notepad and you will feel much better.
Secondly, when connecting to db:
function dbconnect()
{
$link = mysql_connect("localhost", "username", "pwd") or die(" Could not connect : " . mysql_error());
mysql_select_db("table_name") or die("Could not select database");
return($link);
}
(you need $link to close the database later).
Use (" Could not connect : " . mysql_error()); in your calls, so you will KNOW why you failed.

Finally, error 401 Unauthorised is classic: you have not set the correct permissions on the file/directory.
If you use CPANEL (most common), go there, move to the directory you want. Check the permissions. 777 is allow everything... (dangerous!).
Good luck.

2007-05-13 21:11:12 · answer #1 · answered by just "JR" 7 · 0 0

1) Use an account that has a password. I doubt MySQL will allow a connection without a password from PHP. Try setting a password for root and testing with this.
2) Make sure MySQL service is running.
3) Make sure you are identifying the host on which the database is stored correctly when you set up in Dreamweaver ie "localhost" or "127.0.0.1".
4) Make sure that the user accounts you are trying have permissions to access the specific MySQL database.
5) If these steps fail then try to connect manually by pasting the following into a .php page and opening it in a browser.

$host = 'localhost';
$user = 'root';
$password = 'password';
$conn = mysql_connect($host, $user, $pass) or die ('Error connecting to mysql');
$name = 'yourdbname';
mysql_close($conn);
?>

Change user, password and yourdbname to correct values. If you do not get a 'Error connecting to mysql' error, then your connection is working fine. If you really can't get it working in Dreamweaver, then I suggest you just read a few internet tutorials and connect to the database manually. It is a lot easier in the long-term.

2007-05-12 23:00:40 · answer #2 · answered by Anonymous · 1 0

mysql is a database. A Database is a utility used to save archives effectively and components you with a thank you to get admission to that archives. Dreamweaver is a utility device so you might use especially to layout HTML pages/monitors. you could build HTML monitors which could settle for archives from the person and save it into the database(mysql). making use of Dreamweaver you additionally can layout HTML pages that exhibit the archives out of your database. Hypertext Preprocessor is a programming device so you might use to jot down code which will work together between your exhibit created with Dreamweaver and database mysql.

2017-01-09 18:24:12 · answer #3 · answered by porro 3 · 0 0

If you plan to use PHP and MySQL - read some guides on the subjects. There are numerous free guides all over the internet - if you are struggling to connect to the DB, you'll probably have far harder issues later! Depending on what code you have used to connect to the DB, your error sounds like a config error in 'php.ini', or a permissions problem with your web folders - but you need to give a bit more detail really... Good luck!
-------
another check, as I had this problem once, did you install CGI or ISAPI DLL in IIS config? I did CGI and it failed - changed to ISAPI and it worked.

2007-05-12 22:22:23 · answer #4 · answered by GMartin376 3 · 1 0

I was looking for a free download of Dreamweaver I found it here http://j.mp/1p33IBA
I love it!
Cheers ;)

2014-08-23 16:48:17 · answer #5 · answered by Anonymous · 0 0

all I can say is GOOD LUCK finding an answer on this one.

2007-05-12 22:09:56 · answer #6 · answered by Anonymous · 0 0

fedest.com, questions and answers