Tylor_Famous Posted June 18, 2008 Share Posted June 18, 2008 (Thank you for reading this!) Ok I am still new to php and mysql and when I connect to my database I need to have something like this: $dbhost = 'host'; $dbuser = 'root'; $dbpass = 'password'; $dbname = 'name'; Well, before when I had my database with godaddy the host was something like 123.456.78.90.secureserver.net and that worked fine. Well, I switched to a Parallels PLESK virtual server and i have to have the database there and I can't figure out what to put as the host! I tried localhost and 127.0.0.1 and even my server's ipaddress and NOTHING will work and I really need to get it working like TODAY? I need some help! Any help you may have would be GREATLY appreciated! Thank you in advance! Here is my PHP code: <?php $dbhost = 'localhost'; $dbuser = 'USERNAME'; $dbpass = 'PASSWORD'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'TABLENAME'; mysql_select_db($dbname); ?> And here is my Error: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'domainname'@'localhost' (using password: YES) in C:\Inetpub\vhosts\domainname\httpdocs\test\dbtest.php on line 6 Error connecting to mysql Link to comment https://forums.phpfreaks.com/topic/110756-connecting-to-database/ Share on other sites More sharing options...
fenway Posted June 18, 2008 Share Posted June 18, 2008 Is it your server? If not, get this to tell you what to do. But it sounds like you have the wrong password. Link to comment https://forums.phpfreaks.com/topic/110756-connecting-to-database/#findComment-568391 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.