Solved Remote access to Mysql / Maria DB


jimbo45

Well-known member
Pro User
VIP
Local time
3:08 PM
Posts
4,002
Location
Hafnarfjörður IS
OS
Windows XP,7,10,11 Linux Arch Linux
Hi folks
If you are having problems getting remote access to Mariadb / MySQL databases and the DB is hosted on a Debian based Linux server a common fault is that the DB server config is set by default to only accept local host connections.

Assuming you are authorised to acces the DB you need to comment out a line in the config file :


# Broken reverse DNS slows down connections considerably and name resolve is
# safe to skip if there are no "host by domain name" access grants
#skip-name-resolve

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1 <====================================== this line



Screenshot_20220823_111107.png


If you don't do this then the system only listens (usually on port 3306) via local host. The file is on most debian type systems in /etc/mysql/mariadb.conf.d /50-server-cnf but could be different for different distros. If you have MariaDB / MySQL on a Windows server / host then similllar needs to be done although where the config file is ????.

Cheers
jimbo
 

My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7
On windows, the file is my.ini in the mariadb data folder.
 

My Computers

System One System Two

  • OS
    Windows 11 Workstation
    Computer type
    PC/Desktop
    Manufacturer/Model
    doofenshmirtz evil incorporated
    CPU
    Ryzen 9 5950X
    Motherboard
    Asus ROG Crosshair VIII Formula
    Memory
    Corsair Vengeance RGB PRO Black 64GB (4x16GB) 3600MHz AMD Ryzen Tuned DDR4
    Graphics Card(s)
    ASUS AMD Radeon RX 6900 XT 16GB ROG Strix LC OC
    Sound Card
    Sound BlasterX Katana
    Monitor(s) Displays
    3 x27" Dell U2724D & 1 x 34" Dell U3415W
    Hard Drives
    Samsung 980 Pro 1TB M.2 2280 PCI-e 4.0 x4 NVMe Solid State
    Drive
    PSU
    ASUS ROG THOR 850W 80 Plus Platinum
    Case
    ASUS ROG Strix Helios Midi-Tower ARGB Gaming Case
    Cooling
    ASUS ROG Strix LC Performance RGB AIO CPU Liquid Cooler - 360mm
    Keyboard
    Logi Ergo
    Mouse
    Logitech MX Master 3
    Internet Speed
    900/100 Mbps
    Browser
    Chrome
    Antivirus
    Windows Defender, Malwarebytes Pro
    Other Info
    HP M281 Printer
    Logitech Brio Stream webcam
    Yeti X mic
  • Operating System
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop
    CPU
    i7
On windows, the file is my.ini in the mariadb data folder.
Thanks !!!

Will try it on on Windows too. What is strange that even on Windows you can connect to a remote computer via phypmadmin using a browser such as firefox (enter remoteserver ip addr/myphpadmin as the url and it will connect - assuming myphmadmin is installed on the remote server regardless of the settings in the mariadb config file, even though other methods such as hiedisql or data query via excel both of which require an obdc connector won't connect until you disable the only listen to localhost. So some security loophole there it would appear in default settings of phpmyadmin whivh is actually quite a good tool !!!

However unless you are using Apache on Windows and have installed the W.A.M.P stack (Windows, Apache, MySql(MariaDB) and php it might be a moot point since many probably use IIS as their Internet server or equivalent - although Apache is easy too.

I'll have a play with this as it could be a bit of a security nightmare !!.

cheers
jimbo
 
Last edited:

My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7
Back
Top Bottom