MySQL - Remote Access to MySQL | Linux CentOS 6.3 Part 2 // Tips from a Self Taught Developer

preview_player
Показать описание
In this tutorial the self-taught developer talks you through installing and configuring a MySQL server to allow remote access on Linux using CentOS 6.3.

So first, download and install the MySQL server: yum install MySQL MySQL-server

Next make it so as the MySQL server with be running on server startup, issue the following command:

chkconfig mysqld on

Next start the mysqld service

service mysqld start

Next, run the command /usr/bin/mysql_secure_installation in order to set the root password and to delete other users and ultimately to stop the root user from having remote access.

Then you can access the MySQL server, to make a new user, which you can login in as rather than using the root user all of the time.

We add the following line to this file below the area which is [mysqld]
bind-address=10.10.10.30

Note: this IP address needs to be the static IP address of this single machine.

Next, we added a rule to the firewall by editing the /etc/sysconfig/iptables file, by adding the following line to it, above the ssh line:

-A INPUT -p tcp -m state --state NEW,ESTABLISHED -m tcp --dport 3306 -j ACCEPT

Once you have saved and close this file, restart or reload the iptables:

service iptables restart

Potentially, this is the server ready to be used remotely, although you are still required to add a user which has the correct privileges:

No more space available...best just watch the video!!!!

#SelfTaughtDeveloper
Рекомендации по теме
Комментарии
Автор

i love that you left the mistake in the video. A lot of other people would of just redo the video or edit it out, but then the audience would not know what to do when they get that same error/mistake. thank you. +1

Linrox
Автор

That has been an awesome video. I cannot thank you enough for that. I was copying and pasting commands without any understanding. All clear now.

I have one question though. Can we revoke the privilege of showing the information_ schema to james ( not root replicate user )

islambassiem
Автор

There are tons of entries out here for connecting to a MySQL server remotely and you are the only one that addressed the changes needed in the config files that allowed the connection to actually work.  Do you have anything for remote connections to MySQL using SSH and port forwarding which I think is a more secure practice for remote accessing a MySQL server.  Do you have?  Contact me for consulting.

pplacey
Автор

I can connect using the default port 3306 remotely ...
but cant when the port number is change to something like 5123 ...

what can be the issue ?

arifavi