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-numbersChain 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 saveiptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[root@centos-server ~]$ service iptables restartiptables: 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介面?