Wordpress localhost OSX安装:建立数据库连接时出错

时间:2016-04-08 16:22:12

标签: mysql wordpress macos nginx

我的localhost nginx上的Wordpress配置有问题。

在wp-admin配置中,我收到Error establishing a database connection

当我手动创建wp-config时,在mysql日志中我只有Aborted connection 12 to db: 'unconnected' user: 'dimmi' host: 'localhost' (Got an error reading communication packets)

这是我的调试日志:

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Users/patryk/Public/dimmi/dimmi_wordpress2/wp-includes/wp-db.php on line 1488

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Users/patryk/Public/dimmi/dimmi_wordpress2/wp-includes/wp-db.php on line 1518

Warning: mysql_connect(): No such file or directory in /Users/patryk/Public/dimmi/dimmi_wordpress2/wp-includes/wp-db.php on line 1518`

命令行登录和简单的PHP脚本完美运行,文件权限为777。

我有OSX El Captain,使用自制软件安装mysql。我的想法用完了:/

1 个答案:

答案 0 :(得分:0)

问题在于php和mysql.pls之间的关联检查以下内容;

1.检查用户名,密码是否正确
2.检查用户' dimmi'有权获得主持人' localhost'
3.sysql运行吗? (因为你可以从终端登录,mysql正在运行)
4. telnet localhost 3306
(这会回来 "连接到localhost。 逃脱角色是' ^]' "如果你的机器上运行了mysql,请参阅3306)