Inbuilt with multi-purpose announcement bar Check here


[Linux]How To Enable Remote Access For MariaDB
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

#1
Today I will show you how to enable remote access for your MariaDB server, and creating a user to login to remotely. This tutorial is one of many for my planned Linux tutorials and follows my other two related to setting up trinity core on Debian 11.

Step 1: Configuring MariaDB
We will need to edit the MariaDB configuration file in order to allow the server to listen for remote connections. We can access the configuration file by typing the following command:

Code:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Then you will need to scroll down until you find:

Code:
bind-address = 127.0.0.1

and change it to:

Code:
bind-address = 0.0.0.0

After you completed the edit, simply hit control+o followed by control+x to save and exit the file. We will now need to restart the MariaDB server to allow the changes to take affect.

Code:
sudo systemctl restart mariadb

Now let’s check to make sure the server is listening for port 3306 outside of just local host. Type the following command:

Code:
netstat -ant | grep 3306

If you see 0.0.0.0:3306, and it says listen then you are set to move onto the next step.

[Image: Screen-Shot-2023-01-08-at-11.46.19-PM-1024x59.png]

Step 2: Creating A New User With Remote Access
Now that we finished setting up our MariaDB to listen for remote connections, we will now connect to our MariaDB and create a new user with remote access enabled. If you have followed my previous tutorials, then mysql by default doesn’t have a password for local root user. So just hit enter when it ask for the password.

Code:
sudo mysql -u root -p


[Image: Screen-Shot-2023-01-08-at-11.57.49-PM-1024x350.png]

Let’s create a new user account for remote access. To ensure security, please make sure to either restrict access to your IP address or choose a very strong password. Simply replace the username with the username you want and password with the password you want.

Code:
CREATE USER 'username'@'%' IDENTIFIED BY 'password';

Now that you have a new user for remote access, we will grant them access to the databases for your WoW Private Server.

Code:
GRANT ALL PRIVILEGES ON auth.* TO 'username'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON world.* TO 'username'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON characters.* TO 'username'@'%' WITH GRANT OPTION;

Remember to substitute your chosen username in the queries above where it says ‘username’. If you are using this tutorial for databases outside of WoW Emulation, please make sure to select the correct databases when granting permissions.

Finished:
You have now enabled remote access to your database, which can be useful if you are not running your server locally. If you encounter any issues, please make a thread in the support section. Thank you! 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)