MySQL Setup and Security

Reading Time : ~ .

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.
    By Posted On
SENIOR DEVELOPER at MICROPYRAMID

Need any Help in your Project?Let's Talk

Latest Comments
Related Articles
HTTP2 and SPDY Protocols - Make HTTP Faster and Safer Dinesh Deshmukh

HTTP/2, next version of HTTP/1, http/1 can not handle the present web which has become more resource intensive, it cannot processes multiple requests in an ...

Continue Reading...
ELK Stack for Parsing your Logs- Part 2 Jagadeesh V

In Previous Tutorial we looked into Setting up EL Server which can ingest your Syslog files. In this Post, you will learn about pushing your ...

Continue Reading...
Setting Up Gitlab container Registry on own Domain. Jagadeesh V

GitLab Container Registry is a secure and private registry for Docker images integrated completely in Gitlab. In this tutorial we will setup and use GitLab ...

Continue Reading...

Subscribe To our news letter

Subscribe to our news letter to receive latest blog posts into your inbox. Please fill your email address in the below form.
*We don't provide your email contact details to any third parties