PHP无法连接mysql

浏览:1918 发布日期:2016/12/21 分类:求助交流
新部署的LNMP环境,PHP无法连接mysql。
PHP文件能正常执行,mysql也可以通过命令行进行连接。

PHP编译为:./configure \
--prefix=/usr/local/php \
--with-mysql=mysqlnd \
--enable-mysqlnd \
--with-gd \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-fpm 
但当我使用mysql_connect('127.0.0.1','root','root') or die('连接失败');就提示错误信息Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /web/pdo.php on line 3

Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in /web/pdo.php on line 3
最佳答案
评论( 相关
后面还有条评论,点击查看>>