Mysql adds, deletes, and adds Permissions

Source: Internet
Author: User

Mysql adds, deletes, and adds Permissions
Create mysql> insert into mysql. user (Host, User, Password) values ("localhost", "test", password ("1234"); adds a user name named test and Password of 1234, however, this user can only log on locally. If you want to log on remotely, you can change localhost to % to indicate that any computer can log on, or change to a specific ip address to indicate that you can only log on to a specific ip address. Add permissions for mysql> grant all privileges on testDB. * to test @ localhost identified by '20140901'; indicates that you have added any operations on all tables in the testDB database during local login to test. If you want to specify permissions, you can change all privileges to select, update, or delete or a combination of the three. If you want to specify table permissions, you can set testDB. * Changing to testDB.info indicates that operations can be performed on the info table in the testDb database. to specify the access address, you can change @ % to localhost, indicating that user test can only perform database operations locally. Refresh the system permission table mysql> flush privileges; Delete the user mysql> Delete FROM User Where user = 'test' and Host = 'localhost '; delete account and permission mysql> drop user username @ '%'; Change user Password mysql> update mysql. user set password = password ('new password') where User = "test" and Host = "localhost ";

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.