; extension_dir = "./"
; On windows:
extension_dir = "自己php的存放路径ext"
; For example, on Windows:
;
extension=msql.dll
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
extension=php_tidy.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
[Date]
; Defines the default timezone used by the date functions
; https://php.net/date.timezone
date.timezone = Asia/Shanghai
2.SQl端配置修改
php5+SQL8报错SERVER SENT CHARSET (255) UNKNOWN和(HY000/2054)的解决方法:
原本运行好好的php,重启了一下后,报错,但是apache24,php5.5,mysql8.0都设置好了,报错内容为:
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
这是因为在MySQL 8.0.11中,caching_sha2_password是默认的身份验证插件,而不是以往的mysql_native_password。所以和php不兼容。可以降级php,也可以修改MySQL的配置。
我决定修改MySQL的配置。
可是我进入C:Program FilesMySQLMySQL Server 8.0,怎么也找不到配置文件(my.ini或者mysqld.cnf)。
最后在隐藏文件夹ProgramData里找到了,完整路径是C:ProgramDataMySQLMySQL Server 8.0my.ini打开my.ini做如下配置:
[mysqld]
port=3306
character-set-server=utf8
default_authentication_plugin=mysql_native_password
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
然后在cmd里输入net stop mysql80和net start mysql80
net stop mysql80
net start mysql80
3.mysql_connect:The server requested authentication method unknown to the client [caching_sha2_]
PHP或者 python作为后端语言在连接MySQL的时候,会出现一下的警告提醒:
mysql_connect:The server requested authentication method unknown to the client [caching_sha2_password] in on line55
这是由于 PHP或者Python 的读取密码的形式是mysql_native_password;而当前的MySQL的密码形式是:caching_sha2_password;两者不匹配,导致的错误。
解决办法:
mysqli_connect(): (HY000/1045): Access denied for user ‘root‘@’localhost‘ (using password: YES)
原文地址:https://blog.csdn.net/xiatiancc/article/details/128838212
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_46326.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!