15

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,030
  • 21
  • 100
  • 124
Lakmedipro Limited
  • 169
  • 1
  • 1
  • 6

3 Answers3

20

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

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
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,030
  • 21
  • 100
  • 124
Farzaneh Pichlou
  • 2,158
  • 3
  • 13
  • 16
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,030
  • 21
  • 100
  • 124
JohnPS
  • 11
  • 1