MySQL Create user and authorization (CentOS6.5)

Source: Internet
Author: User
Tags mysql create mysql create user zend

1. Related SQL statements

  #创建用户与授权方法 # #本地访问create user ' Zend ' @ ' localhost ' identified by ' 123456 ' ; grant all privileges on zenddb.* To ' zend ' @ ' localhost ' , # #本地访问create user ' Zend ' @ ' 127.0.0.1 ' identified by ' 123456 ' , grant all privileges on Ze nddb.* to ' Zend ' @ ' 127.0.0.1 ' , # #针对远程访问create user ' Zend ' @ '% ' identified by ' 123456 ' , grant all privileges on Ze nddb.* to ' zend ' @ '% ' ; #刷新权限 flush privileges; #撤销用户权限 Delete User revoke all on zenddb.* from ' zend ' @ ' localhost ' ;D rop U SER ' zend ' @ ' localhost '; 

2. Log out of MySQL and restart the service
/etc/init.d/mysqld restart

3. Problem handling
3.1 When connecting to the MySQL database, the dirver have not received any packets from the server
Workaround: After viewing iptables, it is found that port 3306 is blocked by the firewall
[Email protected] support-files]#VI/etc/sysconfig/iptables# Generated by Iptables-save v1.4.7On Tue Nov8  -: -: the  .*filter:input ACCEPT [0:0]:forward ACCEPT [0:0]:output ACCEPT [1:184]-A input-i lo-J ACCEPT-A input-m state--state related,established-J ACCEPT-A input-p tcp-m TCP--dport A-J ACCEPT-A input-p tcp-m TCP--dport the-J ACCEPT-A input-p tcp-m TCP--dport3306-J DROP-A input-p icmp-m ICMP--icmp-type8-J ACCEPT-A input-m state--state related,established-J ACCEPT-A input-p ICMP-J ACCEPT-A input-i lo-J ACCEPT-A input-p tcp-m state--state new-m TCP--dport A-J ACCEPT-A input-j REJECT--reject-with icmp-host-prohibited-A forward-j REJECT--reject-with icmp-host-prohibited-A input-m state--state new-m tcp-p TCP--dport15672-J acceptcommit# completed on Tue Nov8  -: -: the  .
-A input-p tcp-m TCP--dport 3306-J DROP  modification -A input-p tcp-m TCP--dport 3306-j ACCEPT
Next, restart the services to service iptables restart

MySQL Create user and authorization (CentOS6.5)

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.