MySQL Forums
Forum List  »  Newbie

inexplicable permissions issue
Posted by: Donald Subert
Date: September 25, 2014 02:42PM

I have a servlet set up to make a connection with MySql. I have two databases (testDb and jumpGate) and two corresponding users (testUser@localhost and jumpGate@localhost). When I run my tests with the testUser and testDb, it works fine, but when I run with the live user and database, I get "Access denied for user 'jumpGate'@'localhost' (using password: YES)". I cannot find any meaningful difference between the test and live versions. I have tested that the password is correct and given the appropriate grants.

These are the properties files that the Servlet uses to make a connection:

#Test database properties
dbName=testDb
dbUser=testUser
dbPassword=password

#Live database properties
dbName=jumpGate
dbUser=jumpGate
dbPassword=**********

I can effectively rule out any issue with the Java code, as merely swapping one file for the other is the difference between success and failure.

Here is my verification that the databases exist and that the users have the right grants to their respective databases.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| admin |
| cdcol |
| jumpgate |
| mysql |
| performance_schema |
| phpmyadmin |
| testdb |
| webauth |
+--------------------+
9 rows in set (0.00 sec)

mysql> show grants for 'testUser'@'localhost';
+-----------------------------------------------------------------------------------------------------------------+
| Grants for testUser@localhost |
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'testUser'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' |
| GRANT ALL PRIVILEGES ON `testdb`.* TO 'testUser'@'localhost' |
| GRANT INSERT ON `admin`.`connections` TO 'testUser'@'localhost' |
+-----------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

mysql> show grants for 'jumpGate'@'localhost';
+-----------------------------------------------------------------------------------------------------------------+
| Grants for jumpGate@localhost |
+-----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'jumpGate'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' |
| GRANT ALL PRIVILEGES ON `jumpgate`.* TO 'jumpGate'@'localhost' |
| GRANT INSERT ON `admin`.`connections` TO 'jumpGate'@'localhost' |
+-----------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

If anyone can offer insight into why the live version is behaving differently, it would be appreciated.

Options: ReplyQuote


Subject
Written By
Posted
inexplicable permissions issue
September 25, 2014 02:42PM


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.