Create and delete MySQL users

Source: Internet
Author: User

The following articles mainly introduce the actual operation steps for MySQL users. We will first describe them from the creation of user havend, the following is a collective description of the specific operation steps of the article, hoping to bring a lot of help in future study or work.

Create a user, haven:

 
 
  1. create user 'haven'@'localhost' identified by 'haven'; 

Allow local connection only

 
 
  1. create user 'haven' identified by 'haven';  

Remote connection

Authorization:

 
 
  1. grant all privileges on *.* to 'haven'@'localhost';  

Grant all permissions of all databases to the local haven

Delete a MySQL user:

 
 
  1. delete from user where user='haven'; 

View user and host:

 
 
  1. MySQL>use MySQL;  
  2. mysq>select user,host from user;  

The above content is an introduction to the operations of MySQL users. I hope you will gain some benefits.

The above content describes the operations of MySQL users, hoping to help you in this regard.

Edit recommendations]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.