作者:佚名 时间:2024-06-04 12:17:15 阅读:(177)
由于服务器重装之后,在部署环境的时候PHP的版本比之前高了一些,在执行程序的时候却提示:mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead,接下来云梦编程为大家介绍一下解决方法,有需要的小伙伴可以参考一下:
[ error ] [8192]mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
(1)、方法一:关闭错误日志
display_errors = On 改为 display_errors = Off
(2)、方法二:更改数据库链接语法:
$DB = mysql_connect('localhost', 'username', 'password'); //将mysql_connect直接替换为mysqli_connect, $DB = mysqli_connect('localhost', 'username', 'password');
(3)、方法三:更改错误日志报警级别
error_reporting(E_ALL ^ E_DEPRECATED);
以上就是云梦编程为大家介绍的关于mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead的解决方法,了解更多相关文章请关注云梦编程网!