I've managed to allow remote access to our Mysql DB. This is my conf file /etc/my.conf
cat /etc/my.cnf
[mysqld]
local-infile=0
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
bind-address = IP_OF_SERVER
#skip-networking
Issue is, I am able to connect remotely to DB, but if I enable conf file like this, internal application which differs from mine that is using mysql is unable to connect to localhost.
I am not sure how to properly solve this. Are there any additional steps that needs to be done?
I've checked this post, https://stackoverflow.com/a/13811362/5000868 but it isn't clear to me.
This is how my user
table looks like (I didn't included password field on purpose)
-----------------------+----------------+-------------------------------------------+-------------
| Host | User | Password | Select_priv
+-----------------------+----------------+-------------------------------------------+-------------
| localhost | root | * | Y
| localhost.localdomain | root | * | Y
| 127.0.0.1 | root | * | Y
| localhost | | * | N
| localhost.localdomain | | * | N
| localhost | 9r9v17559f9tew | * | Y
| % | 9r9v17559f9tew | *
So to summary, I want to be able to access MySQL with username 9r9v17559f9tew
both remotely & localy.
Thanks!
EDIT
I've added one more user 9r9v17559f9tew
with hostname 127.0.0.1
.
Further, when I try to access DB localy on the server like this I get the following error:
mysql -u 9r9v17559f9tew -p
Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
And if I try to connect localy or remote like this, I am able to connect:
# mysql -u 9r9v17559f9tew -p -h IP_OF_SERVER
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.