Open MySQL remote connection under CentOS, remote Management database

Source: Internet
Author: User
Tags iptables

When the server is not running PHP, not installed phpMyAdmin, remote management of MySQL is necessary. Because it is set under CentOS, the title is added to CentOS, and the following commands should be OK under the Debian system.

    1. MySQL -u root -p mysql # 1th MySQL is the execution command, and the 2nd MySQL is the system data name

In the MySQL console perform:

    1. Grant all privileges on * * to ' root '@'% ' identified by ' 123456 ' with grant Option;
    2. # root is user name,% for any host, ' 123456 ' specified login password (this and local root password can be set differently, not affect each other)
    3. Flush privileges; # Overloaded System permissions
    4. Exit;

Allow Port 3306

  1. Iptables -I INPUT -p TCP -m state --StateNEW -m TCP --dport 3306< c14> -J ACCEPT
  2. # See if the rules are in effect
  3. Iptables -L -n # or: Service iptables status
  4. # The production environment is not secure at this time, the port should be closed after remote management, and the previously added rules should be removed
  5. Iptables -D INPUT -p TCP -m state --StateNEW -m TCP --dport 33 -J ACCEPT

PS, above iptables Add/Remove rules are temporary, if you need to restart after the effective, you need to save the changes:
Service Iptables Save # or:/etc/init.d/iptables save
Other than that
Vi/etc/sysconfig/iptables # plus the following line of rules is OK
-A input-p tcp-m state--state new-m TCP--dport 3306-j ACCEPT

Remote management of the database software, win system can use SQLyog, with several remote software, feel this use is pretty good.

Open MySQL remote connection under CentOS, remote Management 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.