• 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 Mint 20.2

  • 00:39 lsb_release -a
  • 00:50 mysql
  • 01:04 select @@port;
  • 01:18 \q
  • 01:37 cd /etc/mysql/mysql.conf.d/
  • 01:44 ls -la
  • 01:59 nano mysqld.cnf
  • 02:31 systemctl restart mysql.service
  • 02:51 mysql
  • 02:57 select @@port;
  • 03:18 nano mysqld.cnf
  • 03:32 systemctl restart mysql.service
  • 04:04 select @@port;
{{postValue.id}}

To change Mysql Port number On linux Mint 20.2

Introduction:

MySQL is an open-source relational database management system. Its name is a combination of "My", the name of co-founder Michael Widenius's daughter, and "SQL", the abbreviation for Structured Query Language

Installation Procedure :

Step 1 : To check the Os verson by using the following command

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20.2
Release:	20.2
Codename:	uma

Step 2 : Getting into the mysql shell

root@linuxhelp:~# mysql
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 : Checking the port number by using the following command

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

Step 4 : Quit the mysql shell by using the bellow commands

mysql> \q
Bye

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

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

Step 6 : Listing the files in the following directory

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 : editing the mysqld.cnf Configuraion file

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
#
user            = mysql
# pid-file      = /var/run/mysqld/mysqld.pid
# socket        = /var/run/mysqld/mysqld.sock
# port          = 3344
# datadir       = /var/lib/mysql

Step 8 : Restarting the mysql service by using the below command

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

Step 9 : Entering into the mysql shell

root@linuxhelp:/etc/mysql/mysql.conf.d# mysql
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 : Checking the port number

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

Step 11 : Editing the Configuration file

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

Step 12 : Restarting the mysql service

root@linuxhelp:/etc/mysql/mysql.conf.d# systemctl restart mysql.service
root@linuxhelp:/etc/mysql/mysql.conf.d# mysql
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 13 : Checking the port by using the below commands

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

With this the process of changing port number on mysql has come’s to an end..!!

Tags:
sebastian
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 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 Jayce ?
What are the types of table used in IPtables

What are the various types of table used in IPtables and how to use that for my server security?

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.