How to set up your own windows as a MySQL server

Source: Internet
Author: User

1. Install the MySQL server

2. Create a super user, i.e.

1 User Management2 MySQL> Use MySQL;3 View4 MySQL> select Host,user,password from user;5 Create6 MySQL> Create user Zx_root identified by ' xxxxx ';//identified by will store plaintext password encryption as a hash value7 Modify8 MySQL>RenameUser Feng to NewUser;//can be used after MySQL 5, you need to update the user table using update9 DeleteTen MySQL>drop user NewUser;//MySQL5 before you delete a user, you must first use revoke to remove the user right, and then delete the user, mysql5 the drop command can delete the user's associated permissions at the same time One Change Password A MySQL> Set Password forZx_root =password (' xxxxxx ')); -  MySQL> UpdateMySQL. User set Password=password (' xxxx ') where user= ' OtherUser ' - View User Permissions the MySQL> Show Grants forZx_root; - granting Permissions - MySQL> Grant Select on dmc_db.*to Zx_root; - Reclaim Permissions + MySQL> Revoke select on dmc_db.* from Zx_root;//error if no permissions exist -   + The above command can also be granted and reclaimed using multiple permissions, separated by commas between permissions A MySQL> Grant Select,update,delete, insert on dmc_db.*to Zx_root; at If you want to see the results immediately, use - Flushprivileges; - Command Update -   - you must give a message when setting permissions -1, the permissions to be granted in2, the database or table to which access is granted -3, user name to Grant and revoke can control access at several levels +1, entire server, using grant all and revoke all -2, entire database, using on database.* the3, Feature table, using on database.Table *4, a specific column $5, a specific stored procedurePanax Notoginseng   - meaning of the value of the host column in the user table the%Match all hosts + localhost localhost will not be parsed into an IP address and connected directly via Unixsocket A127.0.0.1 will pass tcp/The IP protocol is connected and can only be accessed natively; the:: 1:: 1 is compatible with support IPv6, indicating the 127.0.0.1 with IPv4 +   -   $ grant Normal data user, the right to query, insert, UPDATE, delete all table data in the database.  $  -Grant Select on testdb.* to [email protected] '%' -  theGrant insert on testdb.* to [email protected] '%' - WuyiGrant update on testdb.* to [email protected] '%' the  -Grant Delete on testdb.* to [email protected] '%' Wu  -Or, with aMySQLcommand to replace: About  $Grant SELECT, INSERT, UPDATE, delete on testdb.* to [email protected] '%' -  -9>.Grant Database Developer, creating tables, indexes, views, stored procedures, functions ... and other permissions.  -  AGrant Create, modify, deleteMySQLdata table structure permissions.  +  theGrant create on testdb.* to [email protected] ' 192.168.0.%'; -  $Grant ALTER on testdb.* to [email protected] ' 192.168.0.%'; the  theGrant drop on testdb.* to [email protected] ' 192.168.0.%'; the  theGrant OperationMySQLforeign key permissions.  -  inGrant references on testdb.* to [email protected] ' 192.168.0.%'; the  theGrant OperationMySQLtemporary table permissions.  About  theGrant create temporary tables on testdb.* to [email protected] ' 192.168.0.%'; the  theGrant OperationMySQLindex permissions.  +  -Grant index on testdb.* to [email protected] ' 192.168.0.%'; the BayiGrant OperationMySQLView , view source code permissions.  the  theGrant CREATE view on testdb.* to [email protected] ' 192.168.0.%'; -  -Grant Show view on testdb.* to [email protected] ' 192.168.0.%'; the  theGrant OperationMySQLstored procedures, function permissions.  the  theGrant create routine on testdb.* to [email protected] ' 192.168.0.% '; -Now,can show procedure status -  theGrant alter routine on TESTDB.* to [email protected] ' 192.168.0.% '; -Now,You can drop a procedure the  theGrant execute on testdb.* to [email protected] ' 192.168.0.%';94  the10>.grant A general DBA manages aMySQLthe permissions for the database.  the  the grant all privileges on TestDB to [email protected] ' localhost '98  About where the keyword "privileges" can be omitted.  - 10111>.grant Advanced DBA ManagementMySQLpermissions for all databases in the. 102 103Grant All on * *to [email protected] ' localhost '104  the12>.MySQLgrant permissions can be used on multiple levels, respectively. 106 1071. Grant's role in the entireMySQLon the server:108 109Grant SELECT On *. * to [email protected]; --DBAs can queryMySQLtables in all databases in the.  the 111Grant all on * * to [email protected]; --DBAs can manageMySQLall databases in the 1132.Grant acts on a single database: the  theGrant Select on testdb.* to [email protected]; --DBAs can query the tables in TestDB.  the 1173.Grant acts on a single data table:118 119Grant SELECT, INSERT, UPDATE, delete on TestDB.orders to [email protected]; - 1214.Grant acts on the columns in the table:122 123Grant Select (ID, SE, rank) on TestDB.Apache_log to [email protected];124  the5.grant acts on stored procedures, functions:126 127Grant execute on procedure TestDB.pr_add to ' dba ' @ ' localhost ' - 129Grant Execute onfunctionTestDB.fn_add to ' dba ' @ ' localhost ' the 131Note: Be sure to refresh the service after modifying the permissions, or restart the service, refresh the service by:FLUSHprivileges.  the  133  134 Permission Table135 Permission Description136  All137 Alter138 alter routine using ALTER procedure and drop procedure139 Create $ create routine using CREATE PROCEDURE141 Create temporary tables using create temporary table142 Create user143 CREATE VIEW144 Delete145 Drop146 execute uses call and stored procedures147 fileusing SELECT INTO outfile and load data infile148 Grant option can use GRANT and revoke149 index can use CREATE INDEX and DROP index Max Insert151 Lock tables Locking table the process using show full processlist153 Reload using flush154 replication Client server location Access155 replocation slave used by replication slaves156 Select157 Show Databases158 Show View159 shutdown using mysqladmin shutdown to turn off MySQL the Super161 Update162 usage does not have access rights163       164       
View Code

In short, it's

Grant all privileges on * * to ' username ' @% identified by ' password ';

Flush privileges;

And then you open the 3306-port firewall.

Then turn on the Telnet service//specific operation of self-Baidu

Then you can use MySQL on another computer.

How to set up your own windows as a MySQL server

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.