• how to change mysql port in wp?

    Answered

    how to change mysql port in wp?

    Bronze Member Asked on August 19, 2016 in Wordpress.
    Add Comment
  • 3 Answer(s)
    Best answer

    If your database is located on a different port, you will need to adjust your connection settings within WordPress to connect to it. In this article, we will show you how to define a custom database port within your WordPress configuration.

      1. First, log into cPanel and open the file manager. If you don’t use cPanel, you may edit open any text editor you like.

     

      1. Within the file manager, you will navigate to your wp-config.php file. This file will be located within your root WordPress directory, typically your public_html directory. Right-click it and click on Code Edit.

     

      1. Now that you have the wp-config.php open, you will want to edit the following line:

        define( ‘DB_HOST’, ‘localhost:3306‘ );

        As you can see, a port number has been added after the “:“. Here, simply add the port number of your database server.

     

    Bronze Member Answered on August 19, 2016.
    Add Comment

    for changing the mysql port, just change my.ini look for this line

     

    port=3306
    my.ini is usually located at
    xammp/mysql/bin/my.ini
    
    C:\MySQL\bin\my.ini
    
    

     

    depending on where you’ve installed.

    Bronze Member Answered on August 19, 2016.
    Add Comment

    You probably have to restart the MySQL server. Disregard WAMP, see if using SQLyog you can connect it to the 1024 port. The code should be changed to:

    
    [mysqld]
    
    #port=3306
    
    port=1024
    
    

    because # is for commenting out the line, so it will be ignored.

    Bronze Member Answered on August 19, 2016.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.