WordPress.org

Support

Support » Localhost Installs » [Resolved] Using a non standard port

[Resolved] Using a non standard port

  • Can anyone offer any assistance when using a non standard port. I am using WordPress with WAMP Server and while I have WAMP Server running on a different port WordPress won’t find the database even if I give it the port number.

    Any help is much appreciated.

    Thanks Daniel.

Viewing 15 replies - 1 through 15 (of 31 total)
  • Are you referring to the MySQL port? because changing the Apache port shouldn’t the affect MySQL connection.

    Here is a good tutor for changing Apache port, just in case you need it.

    http://stackoverflow.com/questions/8574332/how-to-change-port-number-for-apache-in-wamp

    Apache is fine and WAMP Server seems to be running with no problems, it is WordPress that is the problem as it won’t seem to recognise that the port has changed even if I tell it e.g. localhost:1024 it still will not find the database.

    What more can I do, it is very frustrating.

    Cheers Daniel.

    What’s the URL you are accessing it? Because WordPress doesn’t care which port you are using, what’s important is the port number from your browser, like:

    http://localhost:1024/

    or if you have a folder

    http://localhost:1024/wordpressfolder

    this port number is for Apache. If you also changed MySQL port for some reason (let’s say it’s 2000), then you have to edit the wp-config.php, change the host to:

    define('DB_HOST', 'localhost:2000');

    I have made that change in the wp-config.php file. Do I need to specifically change what port MySQL is using? How do I find out the port it is using?

    If I tell wordpress that the database is at localhost it ways it cant find it, if I tell wordpress the database is at localhost:1024 IE can’t find the page.

    Thanks Daniel.

    Have you cleared IE cache? Changing ports shouldn’t be a problem, because I also do it all the time, for security reasons or to bypass block port numbers on the network, never had problems.

    To test if your MySQL port number 1024 really works, try downloading a MySQL client, like (SQLyog free trial):

    http://www.webyog.com/product/sqlyog

    use this to connect to your MySQL server with port 1024. Just trying to rule out the possibilities.

    Thanks for your reply. This is odd, the only port it wants to connect to is using port 3306, if I try port 1024 which is what WAMP Server uses (Apache) it won’t connect. Does this mean that MySQL IS using the wrong port? And if so, how do I change it?

    Thanks Daniel.

    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.

    OK, I found this section of the my.ini file

    [mysqld]
    port=3306
    #port=1024

    If I change the port to 1024 WAMP Server stays on orange!!??

    Thanks Daniel.

    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.

    Oh how annoying! It still won’t work. WordPress will not see the database.

    Oddly, on my own PC I run WAMP Server and WordPress and MySQL is also set to use port 3306? What’s that all about?

    Thanks Daniel.

    Actually this has nothing to do with WordPress. It’s more of WAMP problem in your case.

    Might wanna try your luck at

    http://forum.wampserver.com/

    I think this IS a WordPress problem. WAMP Server works fine. It’s WordPress that won’t work with a different port.

    Someone on here must have setup WordPress on a different port than 80.

    Thanks Daniel.

    I have been on the WAMP Server forum and they think I am setup OK so why won’t WordPress work??? It’s very frustrating.

    http://forum.wampserver.com/read.php?2,110838

    Thanks Daniel.

    Moderator Jan Dembowski

    @jdembowski

    Volunteer Mod. & Brute Squad

    There are 2 separate things in this thread (and really, do not create more duplicates, they’ll be deleted on sight):

    A) You want to move mysql’s port and use that instance on the new port for the database.

    B) You want to use a different Apache port besides port 80.

    Can you narrow it down to what you want to do? It could be A, B, or both A and B. I think it’s just A but I want to be sure.

    OK, what I want to do is get WordPress to run on the port that Apache is running 1024. During the setup process I tell WordPress to use localhost:1024 but I cannot find it. If I just tell it localhost it tells me it cannot find the database, that is where the SQL question came from.

    B is what I am trying to do. WAMP server seems to run fine on port 1024 it’s WordPress that won’t install with this setup.

    Thanks Daniel.

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘[Resolved] Using a non standard port’ is closed to new replies.