Reference article: https://www.jianshu.com/p/f4a98a905011
Check the system version (reference link: https://www.cnblogs.com/YangJieCheng/p/5907166.html)
mysql version:
(I downloaded version 5.7 before, and found that it is different from the version used in the article. There is no scripts file directory, and mysql_install_db is in the bin directory. The installation was not successful. Re-downloaded version 5.6)
start installation:
Unzip the installation package;
Add mysql user group and mysql user;
Modify permissions and execute the installation script:
cd mysql /
chown -R mysql:mysql ./
./scripts/mysql_install_db --user=mysql
There is a problem when starting mysql:
./support-files/mysql.server start
vim open mysql.server
Change datadir and basedir to the installation directory (the original is empty, the default value quoted below):
Start again, success!
View progress
Log in
Check
Cannot connect when connecting remotely;
Telnet 3306 port can not be connected;
ip can be pinged;
(Reference link: http://www.jb51.net/article/103770.htm)
Check firewall
Turn off the firewall:
Telnet port 3306 again, the connection is successful.
Modify the file:
Add to:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT (allow port 3306 through firewall)
or:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
(Reference link: http://blog.csdn.net/c233728461/article/details/52679558 )
然后重新启动:
并没有起到效果;
执行命令:
再次重启:
远程连接数据库成功!