By continuing to navigate on this website, you accept the use of cookies to serve you more relevant services & content .
For more information and to change the setting of cookies on your computer, please read our Cookie Policy.

MySQL Setup and Security

Installing MySQL:

apt-get install mysql-server

The above command installs MySQL server and its related components. you will be asked to setup a password for the root account. 

Post Installation Measures:

Exposing MYSQL to External Applications:

Edit /etc/mysql/my.cnf and comment the line

bind-address =  127.0.0.1

you can change the port to some no standard ports by changing 

port  =  3306 ----> any port you like

Restart Mysql server with

service mysql restart

This will expose your database, but there are no users that can connect to it. create a database and assign a user to it.

create database test;
grant all privileges on test.l* to test-user@"%" identified by "<some-secret-password>";

This way test-user can connect to database test from any PC.

Few Security tips:

  1. If only applications are meant to be connected setup firewall rules to specific IP Addresses to connect to that port.
  2. you can change location and encrypt mysql MySQL
  3. change admin username from root.
    Posted On
  • 25 December 2013
  • By
  • Micropyramid

Need any Help in your Project?Let's Talk

Latest Comments
Related Articles
Fabric - Learning part1

Using Fabric, we can configure Linux production server with uwsgi, nginx, vsftpd, mysql, mongodb, postfix, php, python tools, and other relevant pieces of software single-handedly ...

Continue Reading...
Ansible for Server Process Automation

Ansible is one of the few automation tools which uses an agentless architecture, where you dont need to install daemons in client nodes for interacting ...

Continue Reading...
TMUX - Sharing terminal between Users

More Often you wouldve come across sharing screens with applications like Teamviewer, Windows Remote Desktop Connection or remmina (if you're a linux user). But if ...

Continue Reading...
open source packages

Subscribe To our news letter

Subscribe and Stay Updated about our Webinars, news and articles on Django, Python, Machine Learning, Amazon Web Services, DevOps, Salesforce, ReactJS, AngularJS, React Native.
* We don't provide your email contact details to any third parties