Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

change mysql port ? :(

Discussion in 'Database Discussion' started by setrow, Aug 18, 2010.

  1. setrow

    setrow Registered

    Joined:
    Dec 28, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    Hi,
    Cpanel Mysql use 3306 port and we want to change 6446 for mysql port

    What will we do ? We cant change 3306 port :(

    Thanks.
     
  2. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    243
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    Coralville, Iowa USA
    cPanel Access Level:
    Root Administrator
    You can change the MySQL port in the /etc/my.cnf file:

    Code:
    port=6446
    Then restart MySQL:

    Code:
    /etc/init.d/mysql restart
    I did this change on my machine as a test and had no issue whatsoever changing it. Here's the results showing it began listening on that port after the change:

    Code:
    [root@itchy:~] # ps aux|grep mysql
    root 10660 0.3  0.1 6744 1076 pts/0 S 07:29 0:00 /bin/sh /usr/bin/mysqld_safe
    --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/hostname.com.pid
    
    mysql 10805 3.8 15.5 1510596 155372 pts/0 Sl 07:29 0:00 /usr/sbin/mysqld
    --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/hostname.com.pid 
    --skip-external-locking --port=6446
    Notice the --port=6446 part in the ps aux return?

    Code:
    [root@itchy:~] # lsof -i :6446
    COMMAND   PID  USER   FD   TYPE   DEVICE SIZE NODE NAME
    mysqld  10805 mysql   12u  IPv4 60642652       TCP *:6446 (LISTEN)
    Code:
    [root@itchy:~] # netstat -an|grep :6446
    tcp        0      0 0.0.0.0:6446          0.0.0.0:*             LISTEN
    As a final note, I did also check PhpMyAdmin and cPanel > MySQL Databases area. Both were working for me after this change, so this did not impact the various cPanel areas working on my server.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 Miraenda, Aug 18, 2010
    Last edited: Aug 18, 2010
  3. prashant_ohol

    prashant_ohol Active Member

    Joined:
    Nov 22, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156
    good one Miraenda,


    Prashant
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice