java - MySQL: Giving all rights over a database to a user but user can't even see database -


problem:

i'm using local mysql database on ubuntu 15.10.

i have 2 users: root user , user called java password password. latter used java jpa test application.

i need 'java'@'localhost' have privileges videogames database (i'm unconcerned security).


what did

i use mysql -u root -p console, grant privileges on mydb.videogames 'java'@'localhost' grant option.

then mysql -u java -p , show databases, showing few databases user java has access doesn't show videogames database.

connecting java/jpa app gives throws exception access denied user 'java'@'localhost' database 'videogames' (error code: 1044)


i have tried:

  • grant privileges on mydb.videogames 'java'@'%' grant option
  • grant privileges on mydb.* 'java'@'%' grant option
  • flush privileges
  • sudo service restart mysql
  • drop user ''

dumps of show grantss:

  • grants java@%
    • grant usage on *.* 'java'@'%'
    • grant privileges on 'mydb'.* 'java'@'%' grant option
    • grant privileges on 'mydb'.'videogames' 'java'@'%' grant option
  • grants java@localhost
    • grant usage on *.* 'java'@'localhost' identified password '*2470c0c06dee42fd1618bb99005adca2ec9d1e19'
    • grant privileges on 'javabase'.* 'java'@'localhost'
    • grant privileges on 'mydb'.* 'java'@'localhost' grant option
    • grant privileges on 'mydb'.'videogames' 'java'@'localhost' grant option

dump of select user, host mysql.user;:

+------------------+--------------------------+ | user | host | +------------------+--------------------------+ | java | % | | root | 127.0.0.1 | | root | ::1 | | root | (name of pc) | | debian-sys-maint | localhost | | java | localhost | | root | localhost | +------------------+--------------------------+


any appreciated.

video games database , not table.

everything before dot database, after table.

so right:

grant privileges on videogames.* 'java'@'localhost' grant option 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -