MySQL Forums
Forum List  »  Newbie

Re: Access denied for user - new setup issue
Posted by: Julian Davtchev
Date: August 09, 2004 03:47PM

MYSQL MANUAL:
1----------------------------------------------------------------------------
...
First, use the mysql program to connect to the server as the MySQL root user:

shell> mysql -u root mysql


If you have assigned a password to the root account, you'll also need to supply a --password or -p option for this mysql command and also for those later in this section.


After connecting to the server as root, you can add new accounts. The following statements use GRANT to set up four new accounts:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
...
1----------------------------------------------------------------------------
The problem is the user you're using probably have no grant privileges. You can check the user you're logged in as:
SELECT CURRENT_USER(); -> the user recongnized by the grant tables
2---------------------------------------------------------------------------
e.g.
mysql> SELECT USER();
+--------------------+
| USER() |
+--------------------+
| testuser@localhost |
+--------------------+
1 row in set (0.00 sec)

mysql> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| @localhost |
+----------------+
1 row in set (0.00 sec)

mysql> SHOW GRANTS FOR ''@localhost; //check if you have grant option over mysql database.


2-------------------------------------------------------------------------

SELECT USER(); -> the user you typed in when connecting (e.g mysql -u testuser)
You could check the current users defined with:
SELECT user,host FROM mysql.user;

Hope I've helped.

Options: ReplyQuote


Subject
Written By
Posted
Re: Access denied for user - new setup issue
August 09, 2004 03:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.