1."com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago."
解决方案:
vi /etc/mysql/my.cnf
#bind-address = 127.0.0.1 // 注释掉
service mysql restart
2."Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server"
解决方案:
CREATE USER 'admin'@'%' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON \*.\* TO 'admin'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
FLUSH privileges
参考:stackoverflow