Jump to content

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


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

PROBLEM SOLVED

 

I'm not allowed to create Db's just create tables on the db they provide for me(a db who's existence I was not made aware of till just now), and it only took 2 days to figure this out...it's fun to be an intern.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.