MySQL Create a user name, authorize, revoke permissions, create a database

Source: Internet
Author: User
Tags mysql create

/*2016-5-5*/--the full SQL Handbook and began to learn MySQL grammar--half a month in bed, bored,,,
/*mysql this selects the database character set and database proofing rules:   If character set x and collate y are specified, character set X and proofing rule Y are used.   If character set x is specified and no collate y is specified, then character set x and Character set are used The default proofing rules for  x.   Otherwise, the server character set and server proofing rules are adopted.   If the table character set and proofing rules are not specified in the Create table statement, the database character set and proofing rules are used as default values. */--grant select,update,insert on mysql.* to [email protected] indentified  by  ' guest123 ' error, grant before the user needs to actually exist-to create a locally logged on user Guest, whose login password is guest123 (login password is not the user password itself?). Next experiment) create user  ' guest ' @ ' localhost '  identified by  ' guest123 '--Create database guest and character set to UTF-8 , proofing rules for utf8_bincreate database guest default character set utf8 collate  utf8_bin--assign Insert,update,select permissions to guestgrant insert,update,select on mysql.* at native logon  to  ' guest ' @ ' localhost '--insert,update,select privileges owned by guest at the time of the native login Revoke insert,update,select  on mysql.* from  ' guest ' @ ' localhost '--will INSERT,UPDAte,select permissions give the guest that is logged on to the machine and allow it to re-authorize grant insert,update,select on mysql.* to  ' guest ' @ ' localhost '  with grant option--Experiment Identified by statement defines whether the password is a login password or a user password,create user  ' Guest1 ' @ ' localhost '--this is not identified--querying the MySQL library if the authentication_string field of the user table is empty use mysql;select  authentication_string from user where user =  ' Guest1 '

Query results, no content

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s4.51cto.com/wyfs02/m00/7f/b9/wkiol1cqxwfa-rzgaaae26khuim106.png "title=" no password query. png "alt=" Wkiol1cqxwfa-rzgaaae26khuim106.png "/>

Select authentication_string from user where user = ' guest '

Set password query results, with encrypted code

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7F/BA/wKioL1cqxXazuFrdAAAfGOu915g536.png "title=" There is a password query. png "alt=" Wkiol1cqxxazufrdaaafgou915g536.png "/>


Reference to http://my.oschina.net/u/1179414/blog/202377 's article.


MySQL Create a user name, authorize, revoke permissions, create a database

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.