I cannot access MySQL server on my Ubuntu 16.04.02 VPS from Azure. I tried editing /etc/mysql/my.cnf but nothing - there is nothing like bind I created user with wildcard, but I am still getting connection refused. What can I do?


# 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/

Output from terminal:

azure@pinf-vps:~$ sudo lsof -Pni :3306
mysqld  29117 mysql   15u  IPv4 2516519      0t0  TCP (LISTEN)

I have also doublechecked if the port is open on the VPS and in the firewall.

Thank you for help.

  • 1
    At the end of file 2 dirs with configs are included, you must search there for that This will narrow your search : find /etc/mysql/conf.d/ -iname '*.cnf' | xargs grep 127 -sn and find /etc/mysql/mysql.conf.d/ -iname '*.cnf' | xargs grep 127 -sn – bistoco Mar 12 '17 at 18:17
  • @bistoco - you helped me a lot! Thank you! It was in /etc/mysql/mysql.conf.d/mysqld.cnf – Ondrej Vrabel Mar 12 '17 at 18:26

In Ubutu 16.04, the location of the config file you're looking for is /etc/mysql/mysql.conf.d/mysqld.cnf

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.