How to Change Default MySQL/MariaDB Port in Linux? Last Updated : 16 Feb, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report The default port that the MySQL database server runs under Linux is 3306/TCP. Use the commands below to change the default MySQL/MariaDB Database port in Linux. vi /etc/mysql/mariadb.conf.d/50-server.cnf Search for the line MYSQL, find port under this line, and replace port values accordingly. [mysqld] port = 12345 After adding the port save the file and then replace the MySQL port variable to match your own port number. To verify the port configuration for MySql DB use the ss command. # ss -tlpn | grep mysql # netstat -tlpn | grep mysql You can also display the MySQL port by logging in to the MySQL database, use the -p flag to make remote connections to the MySQL database. # mysql -h localhost -u root -p -P 12345 To make a remote connection with the MySQL database, then you have to explicitly configure it to allow the connection. Remotely login to MySQL server via the below command # mysql -h 192.168.1.1 -P 12345 -u root -p Now once you have changed the MySQL server database, you have to now update your distribution firewall protocols to allow new connections from the TCP port so that clients can remotely connect to the database. Comment More infoAdvertise with us Next Article How to Change the Default Port in Jenkins? A akhilsharma870 Follow Improve Article Tags : Linux-Unix How To Similar Reads How to change the default SSH port in Linux SSH (Secure Shell) is a network protocol used to securely connect to the remote server where the data between the server and client is transferred in an encrypted format. In the world of Linux system administration and security, one essential practice is changing the default SSH port. This article w 7 min read How to Change FTP Port in Linux? Files are either uploaded or downloaded to the FTP server. The files are moved from a personal computer to the server when you upload files. The files are moved from the cloud to your personal computer when the files are downloaded. In order to transfer files through FTP, TCP/IP (Transmission Contro 1 min read How to Change the Default Port in Jenkins? Configuring the port in Jenkins is a fundamental aspect of managing the Jenkins server. By default, Jenkins runs on port 8080, but there are scenarios where you may need to change this port to avoid conflicts with other services or security reasons. Understanding how to configure the port in Jenkins 5 min read How to Change the Default Port in PostgreSQL PostgreSQL is one of the most powerful and widely used relational database management systems (RDBMS) in the world. By default, PostgreSQL listens for incoming connections on port 5432. In this article, we will describe the process of changing the default port for PostgreSQL in detailed and step-by- 6 min read How to Install MySQL/MariaDB in Linux? Installing MySQL or MariaDB in Linux is a straightforward process that provides you with powerful relational database management systems (RDBMS). MySQL and MariaDB are both widely used for web applications, data storage, and other database tasks. They offer similar features, and MariaDB is often see 5 min read How to Change the Default Port in Spring Boot? Spring Boot framework provides a default embedded server i.e. the Tomcat server for many configuration properties to run the Spring Boot application. The application runs on the default port which is 8080. As per the application need, we can also change this default port for the embedded server. In 4 min read Like