Jump to content
  • 0

Unable to Connect remotely MariaDB


Tribalist

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  12/11/18
  • Last Seen:  

HI -

I followed the installation guide on Wiki for CentOS, managed to compile the server. However when I try to use my test VPS IP for mysql connection in conf folder, server cant connect to mysql but if I use 127.0.0.1, it connects just fine.

Tried using Workbench to access my database remotely, but I can't establish a connection. Seems like the mysql server or MariaDB only allows connection from localhost or 127.0.0.1? How do I fix this?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  439
  • Reputation:   29
  • Joined:  12/08/11
  • Last Seen:  

rAthena and the database server will run on the same machine. That's why in the guide, it was set to allow connection from localhost.

If you want to remotely connect, you have to allow connection for the 'your-user'@'your-ip'. This part

Also, if you have installed a firewall or enabled iptables, you have to open and allow connection to your mysql/mariadb port.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1529
  • Reputation:   234
  • Joined:  08/03/12
  • Last Seen:  

Try to add user database privilege.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   76
  • Joined:  06/13/13
  • Last Seen:  

first make a mysql user that suit your need.

replace user, ip, password and your_db to what you need. ip can be "%" which mean can from anywhere

CREATE USER 'user'@'ip' IDENTIFIED BY 'password';
GRANT ALL ON your_db.* TO 'user'@'ip';

note: grant all is bad practice, imo just set permission as you deem fit (i am lazy to look up permission that needed for rA db).

find in file '/etc/mysql/my.cnf' set bind-address value like below. "x.x.x.x" is ip that used when created mysql user or can be set with "0.0.0.0" to match if you use "%" when created mysql user.

#
# Allow server to accept connections on all interfaces.
#
bind-address=x.x.x.x

 

Edited by Litro Endemic
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...