I have a Ubuntu server with multiple websites, each website connects to its own MySQL database - each of my sites have a number of users accessing/updating the MySQL databases.

Currently all my websites are utilizing the the default MySQL port 3306.

I know I'm able to separate the connection of each website so that is uses its own dedicated port to connect to it's MySQL database.

By doing this will this improve the speed of SQL queries? I'm guessing it will... What are other peoples thoughts on this?

  • 9
    No. Using multiple ports won't affect any query performance. Once the connection is established the port effectively becomes irrelevant.
    – user2864740
    Commented Jan 7, 2014 at 4:54

1 Answer 1


Running MySQL on different ports wont make any difference in the Speed of your queries. What you could do is have a look at your Indexes. If you have a WHERE statement, make sure you have in the following order =, !=, in, < / >, like.

If you use 'where' and your 'like' is before '=' your query will run longer.

  • The order in which conditions are placed in the WHERE clause makes no difference. Commented Feb 28, 2014 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.