If I have root on a mysql database and I want to drop privileges to that of a normal user, without using their password, can I do it? if so how? think # su - username
on unix. Basically, I'm just looking to avoid needing their password to be them, so I can test their privileges at their user. In postgres I could simply allow an ident authentication on the system root user, to bypass password auth. The reason I need this is to be able to reproduce a users problem by being them, not being them will not allow an accurate reproduction. I can of course ask for their password, but that takes more time that bypassing it.
Mysql – Can you “su -” in MySQL
MySQLpermissions
Related Question
- MySQL workbench: Cannot Connect to Database Server (ssh)
- Sql-server – Grant Admin to an Active Directory account in SQL Server
- Mysql – Host not Allowed Connectivity to MySQL Server
- Mysql – Help granting MySQL user privileges to one database only
- Mysql – What are the minimal permissions required for the “Users and Privileges” tab in MySQL Workbench to function in MySQL 5.6
- Mysql – How to secure the data queried from the local MySQL server on a remote machine with root shared with untrusted entity
Best Answer
I just realized -- so long as you don't mind locking out the user while you log in --
UPDATE mysql.user SET password=PASSWORD('new password') WHERE user='username' AND host='hostname';
UPDATE mysql.user SET password='saved password hash' WHERE user='username' AND host='hostname';
... you may need to
flush privileges;
after manipulating the mysql.user table.