Error in DB access!

Status
Not open for further replies.

gaymeg15

New Member
Messages
6
Reaction score
0
Points
0
Hi,
I just installed Joomla on mywebsite in the root directory. However, when I try to access the website it is giving me the error...

Database Error: Unable to connect to the database:Could not connect to MySQL

I used a simple code below to check if everything is alright...
<?php
$host = 'localhost';
$user = 'xxxxxxx_jo151';
$pass = 'xxxxxxxxxx';
$db = 'xxxxxxx_jo151';

$conn = mysql_connect($host, $user, $pass);
mysql_select_db($db, $conn);

And I am getting following error...

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'gaymeg_jo151'@'10.33.248.78' (using password: YES) in /home/gaymeg/public_html/new.php on line 8

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/gaymeg/public_html/new.php on line 9


I have checked that the user has all the necessary privileges in the selected database.

Please help.
Thanks.
 
Last edited:

dlukin

New Member
Messages
427
Reaction score
25
Points
0
Some things to try:

1. Use PHPMyAdmin in cPanel and make sure the db is there
2. MySQL Databases in cPanel, make sure the Remote Hosts list looks something like:

10.33.248.%
10.33.249.2
192.168.1.%
int.boru.x10hosting.com
int.mysql.x10hosting.com

were the one with 'boru' has your server name instead.

3. Delete the user and then recreate and re-attach to database
 

gaymeg15

New Member
Messages
6
Reaction score
0
Points
0
Thanks for the information.

The remote host list had only one entry in it i.e. 192.168.1.%

I added the rest of them and everything is working fine now.

Thanks again,
 
Status
Not open for further replies.
Top