I install the MySQL from the Ubuntu server CD (15.04). When installation is finished, I found that the configure files under /etc/MySQL/
, such as my.cnf
and MySQL.cnf
are all empty.
So I want to access my database from other terminals, I did the following job:
- Created a user for host
%
with all privileges; - Made firewall utw allowing MySQL;
- Insert a line in the my.cnf with: bind-address = 0.0.0.0;
- Restarted the MySQL service.
It has no effect. Remote connections are still denied.
I checked the variables in MySQL, the bind_address variable shows binding with 127.0.0.1. And the netstat command shows that port 3306 is only bound with 127.0.0.1.
I don't know why the configure information in my.cnf
has no effect?
The configuration file shows below:
[mysqld]
bind-address = 0.0.0.0
Any one can help me?
Best Answer
In Ubuntu 15.04 the MySQL Server configure file is in:
You can find
bind-address
here. Comment it (by inserting#
at the start of it), and restart your MySQL Server using:Then you can access your MysqlServer from other computer. If you can't, perhaps you need grant some right to the user.
You can see MySQL Server bind-address using:
So you know whether the configuration has taken effect.