Enable Remote Access To MySQL Database Server.

Edit /etc/mysql/my.cnf on debian and ubuntu

add bind-address and comment skip-networking

bind-address    = 192.168.1.1
# skip-networking

bind-address : IP address to bind to and skip-networking : Don’t listen for TCP/IP connections at all. All interaction with mysqld must be made via Unix sockets. This option is highly recommended for systems where only local requests are allowed. Since you need to allow remote connection this line should be removed from my.cnf or put it in comment state.

Grant Remote Access for mysql user.

mysql> GRANT ALL ON remote.* TO 'remote'@'192.168.1.1' IDENTIFIED BY 'remote';
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

Check if you are able to access the remote server

root@laptop:~# mysql -h 192.168.1.2 -uremote -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.0.81-1 (Debian)