Results 1 to 3 of 3

Thread: change mysql port ? :(

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    1

    Unhappy change mysql port ? :(

    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. #2
    Registered Member Miraenda's Avatar
    Join Date
    Jul 2004
    Location
    Coralville, Iowa USA
    Posts
    243

    Default

    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.
    Last edited by Miraenda; 08-18-2010 at 10:39 AM.

  3. #3
    Registered Member
    Join Date
    Nov 2004
    Posts
    44

    Thumbs up

    good one Miraenda,


    Prashant

Similar Threads

  1. Replies: 3
    Last Post: 10-12-2012, 07:54 AM
  2. change mysql port ? :(
    By setrow in forum General Discussion
    Replies: 2
    Last Post: 08-24-2010, 05:26 PM
  3. Change Default Mysql Port and restrict to IP ?
    By fuzioneer in forum General Discussion
    Replies: 4
    Last Post: 10-03-2008, 06:50 PM
  4. change mysql default port
    By jcorreia in forum General Discussion
    Replies: 5
    Last Post: 04-05-2007, 03:38 AM
  5. Change/Add MySQL port
    By reactorh in forum General Discussion
    Replies: 4
    Last Post: 08-14-2006, 06:25 PM
bargain