Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Granting access to database without knowing the password

Tags:

mysql

So, the grant query for granting access for a user to a database is :

GRANT ALL PRIVILEGES ON dbname.* TO dbuser @'%' IDENTIFIED BY 'dbpasswd';

Now, the problem with our system is we do not know the database password and cannot reverse engineer it as it is a hash. Is it possible to explicitly define privileges directly without knowing the database password ?

The current system is too complex to even figure out where the database configuration files are located and working for days on this has yielded no results. Would really appreciate some help.

PS : What does the privileges in user table in mysql database mean ? There are : Select_priv, Insert_priv, Update_priv, Delete_priv but they are defined per user, not on database basis.

like image 930
YD8877 Avatar asked Oct 23 '25 18:10

YD8877


1 Answers

Just don't use the IDENTIFIED BY ... clause, it won't change the current password.

Select_priv, Insert_priv, Update_priv, Delete_priv in the "user" table indicate the user has these rights on all databases (otherwise, these columns are defined to Y in the "db" table)

like image 121
Capsule Avatar answered Oct 26 '25 08:10

Capsule



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!