Create view for users : USER « User Permission « SQL / MySQL






Create view for users

      
mysql>
mysql> CREATE   OR REPLACE VIEW USERS
    ->         (USER_NAME) AS
    -> SELECT   DISTINCT UPPER(CONCAT('''',USER,'''@''',HOST,''''))
    -> FROM     MYSQL.USER;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
    
    
  








Related examples in the same category

1.USER() for current user
2.Execute a SELECT statement similar to the following to view how that user is listed in the user table
3.Use a SELECT statement to view information about that user account
4.Use SELECT statement to view the user account information that is added to the user table
5.Determining the Current MySQL User
6.Find the name of the current SQL user.
7.To delete the account instead
8.Allows logins only from the local network
9.Choose another name besides root