How can I use MySQL on a MAMP set up with CodeIgniter?
In my database.php file,开发者_JAVA百科 I have
$db['default']['hostname'] = 'mylocaldomain:8889';
$db['default']['username'] = 'myusername';
$db['default']['password'] = 'mypassword';
$db['default']['database'] = 'mydb';
$db['default']['dbdriver'] = 'mysql';
I continually, get an error saying that it can't connect. Any help?
Try changing:
$db['default']['hostname'] = 'mylocaldomain:8889';
To:
$db['default']['hostname'] = 'localhost';
or:
$db['default']['hostname'] = '127.0.0.1';
I think you're confusing your apache server's host/port with MySQL's host
精彩评论