Install mysql server first
sudo apt-get install -y mysql-serverif nano is not installed, install it
"sudo apt-get install -y nano"Open mysql configuration with nano
"nano /etc/mysql/my.cnf"Look for bind-address=127.0.0.1 and change 127.0.0.1 with your IP Server, for example your IP Server is 1.1.1.1
bind-address = 1.1.1.1Restart your mysql service
"service mysql restart"Set your iptables to accept connection from port 3306
"/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT"Save your iptables configuration
"/sbin/iptabes-save"Login to your mysql
"mysql -u root -pYourPassword" <-- No space between -p and Your PasswordCreate your database, for example RemoteDatabase
create database RemoteDatabase;Add a mysql user and grant to access your database
GRANT ALL ON RemoteDatabase.* TO UserName@`%` IDENTIFIED BY 'YourAnotherPassword';To check if you can connect to your database, do this from your client computer
mysql -u UserName -h 1.1.1.1 -pAnd finally input your another password.
Tested on Ubuntu Server 12.04
Source 1 (Indonesian Only)
Source 2
0 comments:
:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* : 8-} ~x( :-t b-( :-L x( =))
Post a Comment