Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How do I grant full permissions to a mysql user? Im running MySQL 5.1 on Redhat. I tried using cpanel, but when I use jet profiler it says I do not have full permissions.

I am not too good with ssh, so please be detailed.

share|improve this question

3 Answers 3

From the shell connect to MySQL as an administrator:

mysql -u root -p mysql

Now on the mysql prompt type:

> grant all privileges on DATABASE_NAME.* to USERNAME@localhost identified by 'PASSWORD';
> flush privileges;
> \q

You can read more about GRANT's syntax at MySQL's site.

share|improve this answer

Just insert or update mysql.user with value 'Y' in each column privileges.

mysql> update mysql.user set user='your', host='localhost', .....
mysql> flush privileges;
share|improve this answer

You mention that you're using Cpanel, which usually indicates that you're on a shared hosting server in which case you won't be able to grant full permissions.

If you're not though, then you need to run a SQL command.

You can do this through PHPMyAdmin or through a MySQL client over ssh.

The query you need to run is: GRANT ALL PRIVILEGES TO username@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;

To do this through PHPMyAdmin, select any database and then click on 'SQL' tab in the main window. You can then type it from there. Although in fact if you're using PHPMyAdmin there's a "Privileges" section that you can use rather than running an SQL query.

If you're using command line, then connect over SSH.

Then, run the following command: mysql -u [username] -p

This will drop you into an interactive MySQL prompt and you can paste the queries as above.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.