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 optiongrant privileges on mydb.* 'java'@'%' grant optionflush privilegessudo service restart mysqldrop user ''
dumps of show grantss:
grants java@%grant usage on *.* 'java'@'%'grant privileges on 'mydb'.* 'java'@'%' grant optiongrant privileges on 'mydb'.'videogames' 'java'@'%' grant option
grants java@localhostgrant usage on *.* 'java'@'localhost' identified password '*2470c0c06dee42fd1618bb99005adca2ec9d1e19'grant privileges on 'javabase'.* 'java'@'localhost'grant privileges on 'mydb'.* 'java'@'localhost' grant optiongrant 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
Post a Comment