zoukankan      html  css  js  c++  java
  • LAMP实验三:远程连接MySQL

    MySQL-Front是Windows下一款小巧的管理Mysql的应用程序. 主要特性包括多文档界面, 语法突出, 拖拽方式的数据库和表格, 可编辑/可增加/删除的域, 可编辑/可插入/删除的记录, 可显示的成员, 可执行的SQL 脚本,提供与外程序接口, 保存数据到CSV文件等。

     

    1. 增加帐号。MySQL服务器root帐号被配置成了禁止远程登入,因此需要新增加一个MySQL帐号用于远程管理:

    [root@centos-server ~]$ mysql --host localhost --user root --password mysql
    mysql
    > CREATE USER 'amonest'@'%' IDENTIFIED BY 'xxx'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'amonest'@'%' WITH GRANT OPTION;

     关于MySQL帐号和权限的信息请参考《6.3.2. Adding User Accounts》和《13.7.1.3. GRANT Syntax》。

    2. 配置防火墙。原来的防火墙策略如下:

    [root@centos-server ~]$ iptables -L -n --line-numbers
    Chain INPUT (policy ACCEPT)
    num  target     prot opt source               destination         
    1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
    2    ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           
    3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
    4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22 
    5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 state NEW 
    6    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 
    
    Chain FORWARD (policy ACCEPT)
    num  target     prot opt source               destination         
    1    REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 
    
    Chain OUTPUT (policy ACCEPT)
    num  target     prot opt source               destination 

    按照下面的方式开启MySQL的3306端口:

    [root@centos-server ~]$ iptables -I INPUT 6 -p tcp -m tcp --dport 3306 -m state --state NEW -j ACCEPT
    [root@centos
    -server ~]$ service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
    [root@centos
    -server ~]$ service iptables restart iptables: Flushing firewall rules: [ OK ] iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Unloading modules: [ OK ] iptables: Applying firewall rules: [ OK ]

    3. OK,现在我们打开MySQL-Front,看看是不是出现了熟悉的Windows界面?

  • 相关阅读:
    CentOS6 破解登录密码
    CentOS 添加硬盘创建并挂载分区
    CentOS 安装开发工具包
    CentOS vim的使用
    CentOS tcpdump的使用实例
    CentOS7没有ifconfig/route/arp/netstat等命令的解决方案
    CentOS 查看系统 CPU 个数、核心数、线程数
    Linux系统中的load average
    Python基础-shelve模块
    Python基础-configparser和hashlib模块
  • 原文地址:https://www.cnblogs.com/eastson/p/2597572.html
Copyright © 2011-2022 走看看