开发者

How can I use MySQL on a MAMP set up with CodeIgniter?

开发者 https://www.devze.com 2023-03-07 15:56 出处:网络
In my database.php file,开发者_JAVA百科 I have $db[\'default\'][\'hostname\'] = \'mylocaldomain:8889\';

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

精彩评论

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

关注公众号