Basic Operation 127 is connected to the data

View user information

Premise : After the database connection

  1. View user currently logged on:select user();

  2. With root privileges can view all user information

    select * from mysql.user; Show the user all the information, a lot of character

    * from mysql.user \G; Display all the user's own field

    select user,password,host from mysql.userDisplay the user's user, password, host these three fields

  3. The root login, delete tourists (after the operation to restart the mysql service)

    Visitors can view all of the users, and then delete a user a tourist, where + Conditions

    delect from mysql.user where user='';

Change the root user's password management

  1. Go modifications without logging in

    mysqladmin -u username -p password -h old domain password "New Password"

    mysql -uroot -p123 -hlocalhost password "456" will be changed to 456 123 Password

  2. Modify the root download

    mysql> set password for the user name @localhost = password ( 'new password');

    mysql> set password for root@localhost = password('123');

After logging database, create user

They grant permissions on the database table name to name username @ hostname identified by 'password';

Guess you like

Origin www.cnblogs.com/xichenHome/p/11569136.html