php - Default Port required on MySQL Connection -


i installed mysql on os x mountain lion box , got work. now, i'm having problems getting new wordpress site access , has been suggested server not configured correctly because have supply port. created test code verify 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 gazos'; ?> 

it returns connection. errors out if remove port. have similar in non-wordpress website works fine. don't remember configuring mysql. installed it. when checked my.cnf file, commented out except:

sql_mode=no_engine_substitution,strict_trans_tables 

is normal supply default port on connection? if not, need fix.

try new mysqli('127.0.0.1', 'root', 'somepassword', 'gazos');


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -