mysql_usercreate
Mysql User Creation
1 |
CREATE USER 'luke' @ 'x.x.x.x' IDENTIFIED BY 'testpassword' ; |
1 |
CREATE USER 'luke' @ '%' IDENTIFIED BY 'testpassword' ; |
Setting user password
1 |
SET PASSWORD FOR 'root' @ 'localhost' |
Deleting a user
1 |
drop user 'luke' @ 'x.x.x.x' ; |
Checking MySQL Password
Sometimes you forget the password for a user. This is annoying as hell. You have a list of old passwords but you are able to log in as root You can use the following to confirm if the password is correct:
1 2 3 4 5 6 7 |
mysql> select if (password( 'randompassword' )=password, 'YES' , 'NO' ) from mysql.user where user= 'lukeslinux' ; +-----------------------------------------------------+ | if (password( 'randompassword' )=password, 'YES' , 'NO' ) | +-----------------------------------------------------+ | YES | +-----------------------------------------------------+ 1 row in set (0.00 sec) |
mysql_usercreate.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1