自升级到MAMP v 3.5以来出现SQL错误

时间:2015-12-16 15:54:01

标签: sql wordpress

我有一个脚本,我运行以创建一个Wordpress网站。一切顺利,直到我到达:

wp core install --title=$client --url=$client.local --admin_user=$clientshort-admin --admin_password=******** --admin_email=********@gmail.com

我得到以下内容:

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Applications/MAMP/htdocs/pndesign2/web/wp/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 /Applications/MAMP/htdocs/pndesign2/web/wp/wp-includes/wp-db.php on line 1518
Warning: mysql_connect(): No such file or directory in /Applications/MAMP/htdocs/pndesign2/web/wp/wp-includes/wp-db.php on line 1518
Error: Error establishing a database connection

谢谢!

1 个答案:

答案 0 :(得分:1)

在循环之后,它归结为OSX / MAMP /和WP-CLI之间的PHP版本差异。 使用MAMP版本更新.bash_profile解决了它 - 更多细节How to override the path of PHP to use the MAMP path?