Friday, January 26, 2018

postgresql - Check ip of logged in user

To get Logged in user IP

Run Query :
postgres=> select inet_client_addr();

Tuesday, January 9, 2018

mysql - Check IP of logged in user


Run Query :

mysql> select user();



Mysql 5.7 - Update root password

mysql 5.7 does not have password field in user table of mysql database. They have come up with new idea i.e. authentication_string for security purpose.

Here is way to update mysql superuser password using command line.
UPDATE mysql.user SET authentication_string=PASSWORD('sToituY78hebrt'), plugin='mysql_native_password' WHERE User='root' AND Host='localhost';

where sToituY78hebrt is my root password