Marcus Declementi
Marcus Declementi

Reputation: 19

Make MYSQL on Linux able to be accessed remotely

I have my database built in MYSQl on Linux.

I want to be able to connect to the server remotely.

Upvotes: 1

Views: 57

Answers (1)

angelcool.net
angelcool.net

Reputation: 2546

General steps for connecting to MySQL remotely:

1.- Create an account for the remote user

GRANT ALL PRIVILEGES ON db_name.* TO 'remoteuser'@'%' IDENTIFIED BY 'secret-passwd'

2.- Open port 3306, this will very depending on your linux distribution, eg: in CentOS 6.5 will be:

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

3.- Connect remotely, in this example I will use the mysqli client

mysql -h remote.mysqlserver.com -u remoteuser -p

Good luck!

Upvotes: 4

Related Questions