Navicat connecting to MySQL in a virtual machine (CentOS)

Source: Internet
Author: User
Tags mysql in iptables

Directly on the method: first configure the CentOS firewall iptables rule:
    1. # vim /etc/sysconfig/iptables
Add the following rules to them:
    1. -A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
    2. -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
    3. -A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
Description: Firewall open HTTP with 80 ports and 3306 ports connected to MySQL.
    1. # service iptables restart
Then configure MySQL to allow remote login: Connect the MySQL database in CentOS first
    1. # mysql -uroot -proot
Perform
    1. > GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY‘123456‘ WITH GRANT OPTION;
Then execute the next
    1. > flush privileges;
Do not restart the MySQL service. After the final configuration is complete, open the Navicat under Windows to connect directly to the database under CentOS.

Navicat connecting to MySQL in a virtual machine (CentOS)

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.