Allow remote connections to mysql

Run a command like below to access from all machines.

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘USERNAME’@’%’ IDENTIFIED BY ‘PASSWORD’ WITH GRANT OPTION;
Run a command like below to give access from specific IP.

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘USERNAME’@’1.2.3.4’ IDENTIFIED BY ‘PASSWORD’ WITH GRANT OPTION
run the command vim /etc/mysql/my.cnf
comment bind-address = 127.0.0.1 using the # symbol
restart your mysql server once.

In Step 1, if you cannot find bind-address in the my.cnf file, look for it in /etc/mysql/mysql.conf.d/mysqld.cnf file

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s