mysql8.0 operation and user authorization

1, check the version of mysql

mysql -V

2, the user operates

# Create a user
 the Create  the User  ' username ' @ ' ip address ' IDENTIFIED by  ' password ' ; 
# users to rename 
the rename the User  ' username ' @ ' ip address '  to  ' new_username ' @ ' ip address ' ; 
# change user passwords 
the ALTER  the User  ' username ' @ ' ip address ' IDENTIFIED by  ' new password ' ;
# delete users
drop  User  ' username ' @ ' IP address ' ;

Note: ip address% is arbitrary address, if 192.168%.

3, permission to operate

# View Permissions 
Show Grants for  ' username ' @ ' ip address ' 
# authorizing 
grant permissions on the database name table name. To  ' username ' @ ' ip address ' ; 
# withdraw the authorization 
revoke privileges on . Database name table name from  ' username ' @ ' IP address ' ;

 

Guess you like

Origin www.cnblogs.com/wt7018/p/11080189.html