2

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 access my database from other terminals, I did the following job:

(1) Created a user for host '%' with all privileges; (2) Made firewall utw allowing MySQL; (3) insert a line in the my.cnf with: bind-address = 0.0.0.0;

(4)restart the MySQL serverice.

it does no effect. Remote connect is 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 binded with 127.0.0.1. I don't know why the configure information in my.cnf has no effect?

The configure file shows below:

[mysqld] bind-address = 0.0.0.0

Any one can help me?

3

In ubuntu 15.04 the MySQL Server configure file is in:

/etc/mysql/mysql.conf.d/mysqld.cnf

You can find bind-address here.Comment it, and restart your MySQL Server use :

service mysql restart

Then you can access your MysqlServer from other computer. If you don't, perhaps you need grant some right to the user you use.

You can see MySQL Server bind-address use:

netstat -tap | grep mysql

So you know whether the configure take effect.

  • 1
    Thanks for this. I was looking in my.cnf which no longer contains the bind-address – Ilan May 10 '16 at 6:14
0

Line 59 of my.cnf says:

bind-address        = 127.0.0.1

You'll probably need to change this instead of inserting a new line at the end of the file.

That being said, I recommend, if possible, using SSH with port forwarding to access MySQL remotely instead of opening up your MySQL port to the world.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.