Mysql statement for creating a new user

Source: Internet
Author: User

Create a new user in mysql. First, log on with the root permission to create the user SQL code create user username identified by 'Password '; www.2cto.com this user can log on to the database in any place. The SQL code create user username @ ip identified by 'Password'; the SQL code grant privileges on database is limited to the login host for new users. table to user @ ip identified by "password" select, insert, update, delete, all in this way, the changes to the database are immediately written into the memory, takes effect immediately, no need to restart the server, but after logging on as a new user, the system prompts ERROR 1045 (28000): Access denied for user 'database' @ 'localhost' (using password: YES) www.2cto.com anonymous users need to be deleted to log on to the SQL code use mysql select host, user from mysql as root; several records with empty user items are found, delete the SQL code delete from mysql where user = ""; the operation still involves permissions, but the non-grant operation does not instantly write the memory, or restart, or the SQL code flush privileges;

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.