How Do I Enable Remote Access To My.SQL Database Server Craft. Internet Cyclone 2 17 Final . By default, remote access to the My.SQL database server is disabled for security reasons.However, sometimes you need to provide remote access to database server from home or a web server.This post will explain how to setup a user account and access a My.SQL server remotely on a Linux or Unix like systems.Task My. SQL Server Remote Access.You need type the following commands which will allow remote connections to a mysql server.Step 1 Login Using SSH if server is outside your data centerFirst, login over ssh to remote My.SQL database server.You may need to login to your My.SQL server as the root user ssh userserver.OR directly login as root user if allowed Step 2 Edit the my.Once connected you need to edit the My.SQL server configuration file my.If you are using DebianUbuntu Linux file is located at etcmysqlmy.If you are using Red Hat LinuxFedoraCentos Linux file is located at etcmy.If you are using Free.BSD you need to create a file vardbmysqlmy.Issuu is a digital publishing platform that makes it simple to publish magazines, catalogs, newspapers, books, and more online.Easily share your publications and get.Windows. Download DWIM Perl 5.Released on, the DWIM Perl for Windows package contains Strawberry Perl 5.Padre 0. 94. Perl is a family of highlevel, generalpurpose, interpreted, dynamic programming languages.The languages in this family include Perl 5 and Perl 6.Edit the etcmy. Step 3 Once file opened, locate line that read as followsmysqld Make sure line skip networking is commented or remove line and add following linebind addressYOUR SERVER IPFor example, if your My.SQL server IP is 6.English. bind address 6.Where,bind address IP address to bind to.Do not listen for TCPIP connections at all.All interaction with mysqld must be made via Unix sockets.Debian Perl Dbd Mysql Install On Mac' title='Debian Perl Dbd Mysql Install On Mac' />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.Step 4 Save and Close the file.If you are using Debian Ubuntu Linux, type the following command to restart the mysql server etcinit.OR systemctl restart mysql.If you are using RHEL Cent.OS Fedora Scientific Linux, type the following command to restart the mysql server etcinit.OR systemctl restart mysqld.If you are using Free.BSD, type the following command to restart the mysql server usrlocaletcrc.OR service mysql server restart.Step 5 Grant access to remote IP address.Connect to mysql server mysql u root p mysql.Grant access to a new database.If you want to add a new database called foo for user bar and remote IP 2.CREATE DATABASE foo mysql GRANT ALL ON foo.TO email protected2.IDENTIFIED BY PASSWORD How Do I Grant Access To An Existing Database Let us assume that you are always making connection from remote IP called 2.To grant access to this IP address type the following command At mysql prompt for existing database, enter mysql update db set Host2.Dbwebdb mysql update user set Host2.Step 6 Logout of My.SQLType exit command to logout mysql mysql exit.Step 7 Open port 3.You need to open TCP port 3.BSD pf firewall. A sample iptables rule to open Linux iptables firewallsbiniptables A INPUT i eth.ACCEPTOR only allow remote connection from your web server located at 1.A INPUT i eth. 0 s 1.ACCEPTOR only allow remote connection from your lan subnet 1.A INPUT i eth. 0 s 1.ACCEPTFinally save all rules RHEL Cent.OS specific command service iptables save.A sample Free. BSD Open.BSD Net. BSD pf firewall rule etcpf.Use the following to open port 3.BSD based systems pass in on extif proto tcp from any to any port 3.OR allow only access from your web server located at 1.SSA synproxy state.Step 8 Test it. From your remote system or your desktop type the following command mysql u webadmin h 6.Where, u webadmin webadmin is My.SQL username h IP or hostname 6.My. SQL server IP address or hostname FQDN p Prompt for password.You can also use the telnet or nc command to connect to port 3.X telnet e X 6. OR nc z w.Sample outputs Connection to 6.Posted by Vivek Gite.The author is the creator of nix.Craft and a seasoned sysadmin and a trainer for the Linux operating systemUnix shell scripting.He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector.Follow him on Twitter, Facebook, Google.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |