MySQL Database Knowledge point collation (continuous update)

Source: Internet
Author: User
Tags mysql host

First, modify the user password

Format (input at command line): Mysqladmin-u User Name----old password password new password

1. Add a password to root Ab12:mysqladmin-uroot-password ab12

2. Change the root password to djg345:mysqladmin-uroot-pab12 password djg345

Second, add new users

Format: Grant permission on the database name. Table name to User name @ login host identified by "password"

1. Add a user test1 password to ABC, so that he can log on any host, and all databases have query, insert, modify, delete permissions. First, use the root user to connect to MySQL, and then type the following command:

Grant SELECT, INSERT, UPDATE, delete on *. * to [email protected] '% ' identified by ' ABC ';

2. Add a user test2 password to ABC, so that he can only login on localhost, and the database mydb can be queried, inserted, modified, deleted operations (localhost refers to the local host, that is, the MySQL database is located on the host), This allows the user to use a password that knows test2, and he cannot access the database directly from the Internet, but only through a Web page on the MySQL host.

Grant Select, inset, update, delete on mydb.* to [e-mail protected] indetified by "ABC";

If you do not want to test2 have a password, you can enter a command again to cancel the password:

Grant SELECT, INSERT, UPDATE, delete on mydb.* to [e-mail protected] identified by "";

  

  

Related Article

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.