Default Port required on MySQL Connection
mysql, php
Solution
Try `new mysqli('127.0.0.1', 'root', 'somepassword', 'gazos');`
Problem
I installed MySQL on my OS X Mountain Lion box and got it to work. Now, I'm having problems getting a new WordPress site to access it and it has been suggested that my server is not configured correctly because I have to supply the port. I created this test code to verify the connection: ``` <?php $mysqli = new mysqli('localhost:3306', 'root', 'somepassword', 'gazos'); if ($mysqli->connect_error) die('Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error); else echo 'Good connection to gazos'; ?> ``` It returns a good connection. It errors out if I remove the port. I have something similar in another non-WordPress website that works fine. I don't remember configuring MySQL. I just installed it. When I checked my my.cnf file, everything is commented out except: ``` sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES ``` Is it normal to supply the default port on a connection? If not, what do I need to fix.