ahmadajah03 Sun Sep 2021 2 years ago

Enable Mysql/mariadb Remote Login On Ubuntu/debian

This tutorial should work on Ubuntu/Debian and any other debian based linux distribution. I used Debian 9 Stretch for the demonstration.

In this video, I demonstrated
- how to enable MySQL/MariaDB remote login
- how to disable MySQL/MariaDB remote login




Commands:

# Install MySQL
sudo apt-get update
sudo apt-get install mysql-server mysql-client


# Enable remote login
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

comment out, bind_address
or put 'bind_address = 0.0.0.0'


# Restart mysql/mariadb
sudo systemctl restart mariadb


# Check status
sudo systemctl status mariadb


# create a mysql user to allow remote login
create user 'username'@'host_address/name' identified by 'password';
grant all on *.* to 'username'@'host_address/name';
flush privileges;


# login to mysql
mysql -u username -h hostname/addr -p
enable mysql remote login mysql remote login ubuntu mysql remote login debian 9 bind_address disable disable skip_networking