19

What is the default port number of MariaDB?

I am new to programming. I am creating my first Java application that connect to MariaDB. I need to specify the database port number.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Divudi Lanka
  • 209
  • 1
  • 2
  • 6

3 Answers3

23

The default port number of MariaDB is 3306. It is the same as MySQL.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
3

The default port number for both MySQL and MariaDB is 3306, but you can change it as required with changing the port variable in the /etc/mysql/mariadb.conf.d/50-server.cnf file (on Debian/Ubuntu) or in the /etc/my.cnf.d/server.cnf (on CentOS/RHEL) and restarting the service ;)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Farzaneh Torkpichlou
  • 2,306
  • 3
  • 14
  • 18
1

The default port number is 3306, the same as MySQL...if you have a trouble with port, I think you should check the firewall or if you need the remote access you can look at the bind address.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JohnPS
  • 11
  • 1