开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜