10

I am attempting to move a mysql db onto an upgraded server with a newer version of ubuntu running (15.04), and after installing LAMP, I went to edit the bind address in the my.cnf file. The below is all I see in /etc/mysql/my.cnf. I added [mysqld] and the bind address = new address but nothing seems to allow my remote client to connect to this db. It is online and the ip address should be correct. What am i missing? Why is this my.cnf so bare?

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
caro
  • 863
  • 3
  • 15
  • 36

3 Answers3

20

stupid me, apparently in this version it is the mysqld.cnf under /etc/mysql/mysql.conf.d/. Oh well. Posting this in case anyone else has problems.....

caro
  • 863
  • 3
  • 15
  • 36
9

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.

Lee Li
  • 392
  • 2
  • 5
  • 11
  • My install also has a /etc/mysql/my.cnf file (which is a symlink to my.cnf -> /etc/alternatives/my.cnf). Which config file is the "correct" one to use to customize the settings? Is it better to edit /etc/mysql/my.conf or /etc/mysql/mysql.conf.d/mysqld.cnf? – orrd Jul 27 '16 at 18:08
0

Depending on your linux distro your my.cnf (as well as the rest of your data directory) may be in /var/lib/mysql folder.

You could also run the find command to look for the file: find -name 'my.cnf'. I suggest running this command as root, in your root directory.

Once you have located the correct my.cnf file there will be a parameter under [mysqld] section that looks like this:

bind-address = 127.0.0.1

Comment this parameter out with a # and save the edited my.cnf file. Restart the Mysql server and you should be able to connect remotely from any IP as long as the user you are trying to connect with as the correct permissions and host(%).

You can check this by running: select user, host from mysql,user;

and show grants for 'youruser'@'yourhost';

grants and privileges for Mysql.

BK435
  • 3,076
  • 3
  • 19
  • 27
  • I did the find, the /etc/mysql/my.cnf is the only location -- and what I posted is ALL it contains which is freaking me out. I'm totally accustomed to editing the bind address line otherwise. Should I assume the LAMP install did not install MySQL correctly? I tried to copy a previous my.cnf into that one but it still will not allow me to remotely connect. – caro Jun 04 '15 at 06:13
  • I did not do it actually, I am taking this project over but I believe it was an Ubuntu 15.05 image file install with LAMP – caro Jun 04 '15 at 11:44