Jump to content

Access denied for user 'intern'@'%' to database 'my_db'


barnigan

Recommended Posts

is your DB local or is in a remote server?

 

if is in a remote server:

- Are you sure that MYSQl is configured to allow remote connection? (networking enabled)

- Or do you know if it is configured to allow access from any IP or specific IP's ?

 

for local:

- check if the grants are correct for that user.

- and the obvious as ManiacDan pointed out... check the password

i don't think so.  I can connect to mysql. I just can't do anything once i'm in

 

$con = mysql_connect("svn.local","intern","qw7t5u9l");

if (!$con) //this part passes
{
  die('Could not connect: ' . mysql_error());
}
else
{
  echo "successfull connection to mysql <br/>";
  if(!mysql_select_db("AbsenceReportDb", $con))//this is true
  {
    echo "attempting to create abenceReportDB <br/>";
    if(mysql_query("CREATE DATABASE absenceReportDB",$con))//this fails
    {
      echo "success database creation<br/>";
    }
    else
    {
      echo "fail database creation: ".mysql_error()."<br/>";
    }
}
else
{
  echo "absenceReportDB already exists<br/>";
}

 

the output of this code is:

 

successfull connection to mysql

attempting to create abenceReportDB

fail database creation: Access denied for user 'intern'@'%' to database 'absencereportdb'

 

 

it is a remote server and i have no idea but i would guess that it is configured for a remote connection since i'm not the only one that uses it

I'm an intern at this company so i'm basically just relying on them saying what i can and can't do

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.