ubuntu install mysql and Foreign exposed port 3306

安装 sudo apt-get install mysql-client mysql-server

  1. /etc/mysql/mysql.conf.d/mysqld.cnf VI
    the bind off 127 Note

  2. mysql.user 授权
    update mysql.user set host = ‘%’ where username = ‘root’

  3. Allow firewall ports
    sudo ufw allow 3306/tcp
    sudo ufw allow 3306
    sudo ufw allow 8080/tcp
    sudo ufw allow 8080
    sudo service ufw restart

  4. Whether cloud hosting or docker External exposure

  5. sudo service mysql restart
    sudo netstat -tap | grep mysql

Guess you like

Origin www.cnblogs.com/wangjiale1024/p/11206436.html