Help - Search - Members - Calendar
Full Version: Access Denied For User 'user_zxq_net_user'@'75.126.138.75' To Database 'user'
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
nate
Can't access the database:

Access denied for user 'quotes_zxq_net_quotes'@'75.126.138.75' to database 'quotes'

here is my php:


<?php
// include "/assets/includes/mysql/config.php";
// include "/assets/includes/mysql/open.php";

// mysql config
$host = "localhost";
$user = "quotes_zxq_net_quotes";
$password = "myPW";
$dbc = mysql_connect($host, $user, $password) or die( mysql_error() );
if (!$dbc) { die( mysql_error() ); }

// open "quotes", as current db
$dbc_selected = mysql_select_db("quotes", $dbc);
if (!$dbc_selected) { die ( mysql_error() ); }

$result = mysql_query("SELECT * FROM quotes WHERE AuthorFirst=Maya and AuthorLast=Angelou", $dbc_selected) or die( mysql_error() );

$num_rows = mysql_num_rows($result) or die( mysql_error() );

$i=0;
while ($i < $num_rows) {

$quote = mysql_result($result,$i,"Quotes");
$first = mysql_result($result,$i,"AuthorFirst");
$last = mysql_result($result,$i,"AuthorLast");

echo "$quote<br>-$first $last<br><br>";

$i++;
}

// include "/assets/includes/mysql/close.php";

// close database
mysql_close($db) or die( mysql_error() );

?>

thank in advance for all of your help
Nate
idontknow
Two things

1) Wrong password
2) User has no access permissions
kirman
That's right. May be you need to set up your user and password in mysql again.

QUOTE
$host = "localhost";
$user = "quotes_zxq_net_quotes";
$password = "myPW";


That's indicate that your MySQL user is "quotes_zxq_net_quotes" and password is "myPW". As an exercise on localhost, I usually use user as "root", and password "root" for the simplest.
Ed
your database (for your select db) should be the full database name; the zymic control panel mysql control panel lists it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.