...

View Full Version : how to connect databse while uploading website



prachippp
08-30-2011, 11:38 AM
I am trying to connect database while uploading my website. It is not connecting. Can anyone please tell me the procedure how to connect database online?
Backend is Mysql

tangoforce
08-30-2011, 01:13 PM
How are you trying to connect? - phpmyadmin, or the remote mysql tool?

Some hosts disable remote connections.

prachippp
08-30-2011, 01:24 PM
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'altondb');

mysql_connect("localhost", "root", "") or die("Could not connect to MySql" . mysql_error());
mysql_select_db("altondb") or die("could not select database" . mysql_error());
?>

using phpmyadmin we are trying to connect.

prachippp
08-30-2011, 01:25 PM
can anybody send me any video links regarding database connectivity through phpmyadmin?

prachippp
08-30-2011, 02:25 PM
<?php
define('DB_HOST', 'www.triviasoftwares.com');
define('DB_USER', 'triviaso_allark');
define('DB_PASSWORD', '');
define('DB_DATABASE', 'triviaso_altondb');

$dbc = mysql_connect('www.triviasoftwares.com', 'triviaso_allark', '') or die("Could not connect to MySql" . mysql_error());
mysql_select_db('triviaso_altondb' , $dbc) or die("could not select database" . mysql_error());
?>



this is code
and the following error occurs

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'triviaso_alton'@'localhost' (using password: YES) in /home/triviaso/public_html/allark/config.php on line 8
Could not connect to MySqlAccess denied for user 'triviaso_alton'@'localhost' (using password: YES)

Fou-Lu
08-30-2011, 02:36 PM
You're user is not authenticated to that database server. Check with your host if that's supposed to be a remote mysql connection or if its still holds on localhost.
In either case, you now have to change your password since you have posted in on a public forum.

prachippp
08-30-2011, 03:23 PM
sorry but
Still getting this error...
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES) in /home/triviaso/public_html/allark/config.php on line 6
Could not connect to MySqlAccess denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES)

Fou-Lu
08-30-2011, 03:35 PM
sorry but
Still getting this error...
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES) in /home/triviaso/public_html/allark/config.php on line 6
Could not connect to MySqlAccess denied for user 'triviaso_allark'@'chief.urlnameserver.com' (using password: YES)

Of course you do.
I specifically said that your user is not authenticated to that server. You will have to contact your host. Either the username and password combination you have provided is invalid or the user is not privileged on that mysql server. This is not a PHP issue, its a server configuration issue.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum