Dino Geek, try to help you

How to change default port in MariaDB?


MariaDB’s default port is 3306. However, you can modify this port following the instructions below:

1. Firstly, open the `my.cnf` file. This is usually located in `/etc/mysql/my.cnf`, `/etc/my.cnf`, or `/etc/mysql/mariadb.conf.d/50-server.cnf` \`\`\` sudo nano /etc/mysql/my.cnf \`\`\` If you can’t find it in these locations, run the following MySQL command to find it: \`\`\` mysql —help | grep “Default options” -A 1 \`\`\`

1. Add or change the port number under the `[mysqld]` or `[mariadb]` section depending on the version in use: \`\`\` [mysqld] port = Your_Desired_Port\_Number \`\`\`

1. Save and close the file.

1. Restart the MariaDB service for the changes to take effect. \`\`\` sudo systemctl restart mariadb.service \`\`\`

Alternatively, if you’re using another service manager, use the relevant command, like: \`\`\` sudo service mariadb restart \`\`\` or \`\`\` sudo /etc/init.d/mysql restart \`\`\`

1. To verify if the port has been changed correctly, run the following command: \`\`\` sudo netstat -plntu | grep mysql \`\`\`
The `Your_Desired_Port_Number` should be replaced with the port number you want the MariaDB server to listen on.

Remember that when you change the default MariaDB port you also need to update your applications to connect to the new port as well.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use