Mysql cannot be accessed through remote machines by default. Remote access can be enabled through the following configuration.
My Mysql environment is ubuntu+mysql5
1. Modify /etc/mysql/my.conf, modify bind-address, Designated as the actual IP address of this machine, your my.con will probably look like the following after modification
[mysqld]
#
#* Basic Settings
#
default-character-set=utf8
default-storage-engine= INNODB
bind-address = 192.168.1.107
user = mysql
pid-file =/var/run/mysqld/mysqld.pid
socket =/var/run/mysq ld/mysqld.sock
port =3306
basedir =/usr
datadir =/var/lib/mysql
tmpdir =//tmp
language =/usr/share/mysql/english
skip-external-locking
2. Log in to mysql with root Execute the following command
grant all onsonardb .* to sonar@'%' identified by '123456';
grant all on sonardb. Username, replace 123456 with your password, thus enabling the remote access function.