General Question on adding users/modify privilages in MySQL

koeks525

Executive Member
Joined
Jul 14, 2012
Messages
6,013
Reaction score
1,199
Location
Canada
Hey everyone,

I have been getting to learning PHP and now, MySQL, which I must say is quite fun :)

I want to add a user to my MySQL database, through PHPMyAdmin, but it keeps giving me an error "access denied", when I try to add the user in the SQL query tab.

I am using GoDaddy, so I had to manually create the user outside PHPMyAdmin. I thought the SQL code to do this would be:

GRANT INSERT, UPDATE, DELETE, SELECT
ON DatabaseName
TO Username@Host
IDENTIFIED BY 'Password';

I ran the above code (of course, inserting real values by DabaseName, Username@Host, 'Password'), and it gives me an error of access denied.

Is the SQL code I am using wrong or is there something that just isn't right??
 
Hey everyone,

I have been getting to learning PHP and now, MySQL, which I must say is quite fun :)

I want to add a user to my MySQL database, through PHPMyAdmin, but it keeps giving me an error "access denied", when I try to add the user in the SQL query tab.

I am using GoDaddy, so I had to manually create the user outside PHPMyAdmin. I thought the SQL code to do this would be:

GRANT INSERT, UPDATE, DELETE, SELECT
ON DatabaseName
TO Username@Host
IDENTIFIED BY 'Password';

I ran the above code (of course, inserting real values by DabaseName, Username@Host, 'Password'), and it gives me an error of access denied.

Is the SQL code I am using wrong or is there something that just isn't right??

You are missing some single quotes and things:

GRANT INSERT, UPDATE, DELETE, SELECT
ON DatabaseName.*
TO 'Username'@'Host'
IDENTIFIED BY 'Password';

Also, are you using the root user to do this?
 
You are missing some single quotes and things:

GRANT INSERT, UPDATE, DELETE, SELECT
ON DatabaseName.*
TO 'Username'@'Host'
IDENTIFIED BY 'Password';

Also, are you using the root user to do this?

Oh...silly me :) I am embarrassed it was over such small things :) No I am not using the root user (I am using GoDaddy) and have specified a Username and a Password for phpmyadmin.

I fix the code now, and I run SQL again, it gives me a weird error: "access denied for user <<some really weird username>>@'localhost' to database 'DatabaseName'
 
Oh...silly me :) I am embarrassed it was over such small things :) No I am not using the root user (I am using GoDaddy) and have specified a Username and a Password for phpmyadmin.

I fix the code now, and I run SQL again, it gives me a weird error: "access denied for user <<some really weird username>>@'localhost' to database 'DatabaseName'

The user you are using probably doesn't have grant permissions. I don't know what setup Godaddy is using, they may limit your MySQL access.
 
Does GoDaddy have cPanel? If so, create the users and grant permission through cPanel.
 
Does GoDaddy have cPanel? If so, create the users and grant permission through cPanel.

They do have cPanel, in fact after creating the new user in cPanel, it asks for the permissions you want to grant. I wanted to try grant permissions in phpMyAdmin.
 
Top
Sign up to the MyBroadband newsletter
X