Create user and enable remote Mysql

1) log-in your mysql via terminal as “root” –> mysql -uroot -p
2) CREATE USER ‘gioinv’@’%’ IDENTIFIED BY ‘your-password’ ;

3)

mysql> GRANT ALL ON database.* TO user@'10.10.0.2' IDENTIFIED BY 'user-password-here';
mysql> FLUSH PRIVILEGES;
(IP can be replaced with % to allow this user to logon from any host or IP.)

If connection still fails, check “bind-address” option in /etc/my.cnf file.

bind-address option is IP address to bind to.

4: /etc/my.cnf file

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
bind-address=192.168.33.10
port = 3306
# skip-networking

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

 

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