• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How To Change MySQL Port Number On Linux Debian 11.3

  • 00:25 lsb_release -a
  • 00:35 mysql -u root -p
  • 01:09 select @@port;
  • 01:25 \q
  • 01:33 cd /etc/mysql/mysql.conf.d/
  • 02:00 nano mysqld.cnf
  • 02:30 systemctl restart mysql.service
  • 02:45 mysql -u root -p
  • 03:03 select @@port;
  • 03:21 \q
  • 03:38 nano mysqld.cnf
  • 03:55 systemctl restart mysql.service
  • 04:13 mysql -u root -p
  • 04:28 select @@port;
  • 04:44 \q
{{postValue.id}}

To Change MySQL Port Number On Linux Debian 11.3

Introduction:

MySQL is an open-source relational database management system. For WordPress sites, that means it helps you store all your blog posts, users, plugin information and etc.

Installation Procedure:

Step 1: To check the OS version by using the following command

root@linuxhelp: ~# lsb_release -a

Step 2: Getting into the MySQL shell by using the below command

root@linuxhelp:~# mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28-0ubuntu0.20.04.3 (Ubuntu)
Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Step 3: Check the port number by using the below command

mysql> select @@port;
+--------+
| @@port |
+--------+
|   3306 |
+--------+
1 row in set (0.00 sec)

Step 4: Quit the MySQL shell by using the below command

mysql> \q
Bye

Step 5: Enter into the Configuration directory by using the below command

root@linuxhelp:~# cd /etc/mysql/mysql.conf.d/ 

Step 6: List the files by using the below command

root@linuxhelp:/etc/mysql/mysql.conf.d# ls -la
total 20
drwxr-xr-x 2 root root 4096 Feb 22 03:47 .
drwxr-xr-x 4 root root 4096 Feb 22 01:29 ..
-rw-r--r-- 1 root root  132 Feb 22 00:59 mysql.cnf
-rw-r--r-- 1 root root 2220 Feb 22 03:47 mysqld.cnf
-rw-r--r-- 1 root root 2219 Feb 22 01:29 mysqld.cnf.save

Step 7: Edit the mysqld.cnf Configuraion file by using the below command

root@linuxhelp:/etc/mysql/mysql.conf.d# nano mysqld.cnf

#The MySQL database server configuration file.
#One can use all long options that the program supports.
#Run program with --help to get a list of available options and with
#--print-defaults to see which it would actually understand and use.
#For explanations see
#http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#Here is entries for some specific programs
#The following values assume you have at least 32M ram

[mysqld]#
#*Basic Settings#
#pid-file      = /var/run/mysqld/mysqld.pid
#socket        = /var/run/mysqld/mysqld.sock
user            = mysql
port            = 3344

Step 8: Restart the MySQL service by using the below command

root@linuxhelp:/etc/mysql/mysql.conf.d# systemctl restart mysql.service

Step 9: Enter into the MySQL shell by using the below command

root@linuxhelp:/etc/mysql/mysql.conf.d# mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28-0ubuntu0.20.04.3 (Ubuntu)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Step 10: Check the port number by using the below command

mysql> select @@port;
+--------+
| @@port |
+--------+
|   3344 |
+--------+
1 row in set (0.00 sec)
mysql> \q
Bye

Step 11: Edit the Configuration file by using the below command

root@linuxhelp:/etc/mysql/mysql.conf.d# nano mysqld.cnf

Step 12: Restart the MySQL service by using the below command

root@linuxhelp:/etc/mysql/mysql.conf.d# systemctl restart mysql.service

root@linuxhelp:/etc/mysql/mysql.conf.d# mysql -u root -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Step 13: Check the port by using the below command

mysql> select @@port;
+--------+
| @@port |
+--------+
|   3306 |
+--------+
1 row in set (0.00 sec)

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to change MySQL Port number On Linux Debian 11.3.Your feedback is much welcome.

Tags:
connor
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Is it possible to reset Root's password in MySQL?

A

Yes, it is possible to reset Root's password in MySQL.

Q

Can we customize the data directory path in MySQL?

A

Yes, we can change it by editing the MySQL configuration file.

Q

How to backup the table in a database?

A

To backup the table in a database use mysqldump -u root -p database_name table_name > filename.sql

Q

What is the current stable version of MySQL?

A

The latest stable version of MySQL is 8.0.28.

Q

What kind of Database is MySQL?

A

MySQL is a relational database system.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Ryan ?
how to use visual traceroute tool

Am using traceroute command to check for the route. i got this tool while surfing. So pls help me out installation and usage of Visual traceroute tool.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.