Probably just because I'm not experienced with this sort of thing, but I downloaded MySQL with Apache running, and I'm working with the following code in a PHP file:
public static $connection = NULL;
private static $host = MYSQL_HOST;
private static $username = MYSQL_USER;
private static $passwd = MYSQL_PASS;
private static $db = MYSQL_DBNAME;
public static function init() {
if(!self::$connection) {
self::$connection = new mysqli(self::$host, self::$username, self::$passwd, self::$db);
}
}
It comes up with this when I open it in Firefox:
trying to connect via unix:///var/mysql/mysql.sock (says this doesn't exist—which, it doesn't)
I replaced MYSQL_HOST with 'localhost', MYSQL_USER with both 'mysql' and 'root' (stupid, yes), MYSQL_PASS with both my system password and NULL, and MYSQL_DBNAME with a few more things (I am having trouble finding out what my database name is called, even with MySQLWorkbench...I started learning this entire field of computing two days ago). It does say that a MySQL server is running on my machine, just not sure how to put the legos together here. Most of the settings are default (port 3306 and such). A test database migration over MySQLWorkBench failed (something to do with not reading the number of rows correctly), but otherwise it was fine and dandy, from what I saw.
Any help would be very welcome!