PHP 連線mysql8 報requested authentication method unknown to the client [caching_sha2_password]
新裝了環境,裝了mysql8,PHP連線mysql時總是報:
PHP Warning: mysqli::mysqli(): The server requested authentication method unknown to the client [caching_sha2_password]
雖然只是一個警告但就是連線不上資料庫,摸索了好久才發現從Mysql5 到Mysql8啟用了新的加密方法。
解決辦法:修改mysql配置檔案my.cnf 使資料庫啟用相容的加密方式
sudo vi /usr/local/etc/my.cnf ,在最下面新增如下程式碼:
[mysqld] default_authentication_plugin= mysql_native_password
儲存退出,重啟mysql。
再次執行PHP成功連線mysql。
mac下啟動,重啟mysql命令:
啟動MySQL服務 mysql.server start
停止MySQL服務 mysql.server stop
重啟MySQL服務 mysql.server restart
相關推薦
PHP 連線mysql8 報requested authentication method unknown to the client [caching_sha2_password]
新裝了環境,裝了mysql8,PHP連線mysql時總是報: PHP Warning: mysqli::mysqli(): The server requested authentication method unknown to the client [caching_
phpmyadmin連線MySQL8.0報錯#2054 - The server requested authentication method unknown to the client
發生這種錯誤,是由於MySQL 8預設使用了新的密碼驗證外掛:caching_sha2_password,而之前的PHP版本中所帶的mysqlnd無法支援這種驗證 有幾種方法:1.升級PHP版本,PHP7.xx有支援MySQL8.0的外掛認證 2.修改配置檔案my.cnf 使資料庫啟用相容的
PHP錯誤:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
升級 文件中 sta 否支持 sha2 authent lte 子句 bubuko 使用PHP連接MySQL 8的時候,可能會發生如標題所示的錯誤: SQLSTATE[HY000] [2054] The server requested authentication me
mysql 8.0 錯誤The server requested authentication method unknown to the client
新版 span sql class ring mysql 安裝 line requested cati mysql 安裝了最新版本8.0.11後創建用戶並授權後,授權的用戶連接數據庫提示 The server requested authentication method
Spring Boot連線MySQL8報錯:java.sql.SQLException: Unknown system variable 'tx_isolation'
報錯資訊:java.sql.SQLException: Unknown system variable 'tx_isolation'at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964) ~[mysql
mysql 報錯Authentication method 'caching_sha2_password' is not supported
原文地址:https://blog.csdn.net/u011583336/article/details/80999043 之前工作中用的資料庫多是ms sqlserver,偶爾用到mysql都是運維配置好 ,今天心血來潮,在本地電腦安裝了一個mysql8.**的版本。建好表測試的時候發現報錯。c
php連線mysql報錯mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES)
mysql_connect(): Access denied for user ‘root’@‘localhost’ (using password: YES) 1、連線密碼輸錯,檢查程式碼 2、wamp中因root密碼修改,而導致 路徑:****\phpmyadmin4.1.14 檔案
php連線mysql報錯mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES)
mysql_connect(): Access denied for user ‘root’@‘localhost’ (using password: YES) 1、連線密碼輸錯,檢查程式碼 2、wam
Mysql 使用Navicat連線失敗 報錯 Authentication plugin 'caching_sha2_password' cannot be
Mysql 使用Navicat連線失敗 報錯: Authentication plugin ‘caching_sha2_password’ cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_ p
nacicat連線mysql8及JDBC連線mysql8報錯解決
最近換電腦安裝了mysql8,使用 nacicat連線發現報錯1251- Client does not support authentication protocol 錯誤 從網上百度到原來mysql8 之前的版本中加密規則是mysql_native_password,而在mysql
Python 連線oracle 報錯 :oci.dll is not the correct architecture 解決方案
完整錯誤:DPI-1047: 64-bit Oracle Client library cannot be loaded: "D:\app\xyg\product\11.2.0\client_1\bin\oci.dll is not the correct architect
HBase:java api連線hbase報錯 ERROR AsyncProcess: Failed to get region location
1.問題描述 JavaAPI操作HBase資料庫報錯如下,經檢查,HBase本身沒有問題,可以建立以及新增資料。但是javaapi就是連線不上去,坑了兩天沒有思路。該式的方法都試了,centos和windows的hosts都配置了對應的域名,但是就是連線不上去。 18/1
Ubuntu連線MySql報錯“can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'”
在不重新安裝mysql的情況下,通過如下命令來解決,具體的就是先停止mysql服務,再重新開啟mysql服務 cd /etc/init.d sudo service mysql stop sudo service mysql start
docker報錯:Cannot connect to the Docker daemon. Is the docker daemon running on this host?
docker這種報錯一般情況都是docker未啟動對於這種情況只用重啟docker就行了: service docker restart 還要一種情況則是docker配置檔案出錯按照提示檢視報錯,並找到相應位置進行更改: systemctl status do
SpringMVC配置錯誤頁後, Shiro報錯No SecurityManager accessible to the calling code...
Root Cause: org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager accessible to the calling code, either boun
Shiro報錯No SecurityManager accessible to the calling code, either bound to the org.apache.shiro.util.
問題描述: 專案使用 SpringMVC 並使用 Shiro 來管理Session控制權限。 經常會不定期的發現異常: org.apache.shiro.UnavailableSecurityManagerException: No SecurityM
tomcat啟動報錯Could not publish to the server. java.lang.NullPointerException
tomcat部署好後用了很久,突然啟動報錯: Could not publish to the server. java.lang.NullPointerException 解決方法: 在e
關於tomcat報錯Could not publish to the server
最近在學習相關課程的時候,啟動tomcat時,發現報錯Could not publish to the server. 然後把自己之前上傳的專案開啟以後再次啟動就可以了。 總結了原因: 啟動tomcat時 必須保證已經上傳發布到其中的專案要處於可訪問狀態,也就是要開啟專案
maven+ssm啟動Tomcat報錯 Could not publish to the server. java.lang.IndexOutOfBoundsException 解決辦法
1找到你maven安裝目錄D:\studys\apache-maven-3.5.3-bin\apache-maven-3.5.3\conf找到settings.xml開啟2,新增這段程式碼<mirror> <id>alimaven</id&
java連線MySQL8.0報錯 Unknown system variable 'query_cache_size'
mysql版本8.0.11 java連線mysql 報錯 java.sql.SQLException: Unknown system variable 'query_cache_size' at com.mysql.cj.jdbc.exceptions.SQLError.c