Cant connect to the MySQL server? Help?

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
Ok, I'm brand new at this stuff. I'm trying to set up a blogging program on my website, I followed the directions and I cant get it to work. I created a MySQL database and made a table just as the instructions said. I didn't know about the number of fields because it didn't mention that, so I just made one. Anyway I made sure my username and password are correct and edited the PHP file correctly. But when I access the blog.php file from my browser, like said in the instructions, I get this message:


Warning: mysql_connect(): Access denied for user: '******_@server1.ripplehost.com' (Using password: YES) in /home/******/public_html/orca/ob_head.php on line 50
Could not connect to the MySQL server!

The ****** is my user name and it all seems correct. What could be wrong?
Btw, I'm using MyPHPAdmin to create the table.

Any help would be great.
 

jfall

Diamond Member
Oct 31, 2000
5,975
2
0
Try using localhost as the server in your connection string. If you have SSH access, have you tried connecting to MySQL directly on the server with the same login/password?

Let's see your full connection string, without the password of course
 

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
Connection string? Sorry, I'm really new to this.

This is what the head.php file has in it about the SQL info, so basically I just edit this with my info, save it, upload to my server (with some other files), and run that blog.php file from my browser.. As far as I know I'm not using connection strings or anything.


/* ***** SQL Information ************************************** */
$hostname = "localhost";
$username = "username";
$password = "password";
$database = "database";
$sqlType = "MySQL";
$tableName = "orcablog";


I dont think you mean keep localhost where it says "hostname" do you? I tried that and I still get the same error.
 

jfall

Diamond Member
Oct 31, 2000
5,975
2
0
Disregard that, I thought you may have been using something else for the hostname other then localhost. Are you sure you can connect to the database with the current login information you have?
 

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
It should be. I even created a new user for the database and new password, it still wouldn't work when I tried using that name.
 

cpars

Golden Member
Feb 4, 2000
1,709
0
71
Originally posted by: BZeto
Connection string? Sorry, I'm really new to this. This is what the head.php file has in it about the SQL info, so basically I just edit this with my info, save it, upload to my server (with some other files), and run that blog.php file from my browser.. As far as I know I'm not using connection strings or anything. /* ***** SQL Information ************************************** */ $hostname = "localhost"; $username = "username"; $password = "password"; $database = "database"; $sqlType = "MySQL"; $tableName = "orcablog"; I dont think you mean keep localhost where it says "hostname" do you? I tried that and I still get the same error.

I use localhost for my db connect>
Also my when i create a new database on my host it always created as follows domainName_DBname
Same goes for user name domainname_user
Also make sure you have given permission to user for database in setup

Example:

$dbh=mysql_connect ("localhost", "wncvoice_cpars", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("wncvoice_forum");
 

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
When I create a database it doesn't put the server name in front.

I tried using localhost insead of hostname and still no dice. Also I made sure I have permission. I dont know what it could be, I'll email my host admin or something.

In the meantime I'll keep working on it, thanks for the help and hopefully it wont end now.