我在PHP 7.0上运行MySQL版本8.
当我尝试从PHP连接到我的数据库时,我收到以下错误:
连接错误:SQLSTATE [HY000] [2054]服务器请求客户端未知的身份验证方法
怎么解决?
我正在尝试 dockerise 我的 Django 应用程序。
docker-compose.yml
version: "3.8"
services:
db:
image: mysql:8
command: --default-authentication-plugin=mysql_native_password # this is not working
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootmypass
ports:
- '3306:3306'
cache:
image: redis
environment:
REDIS_HOST: localhost
REDIS_PORT: 6379
ports:
- '6379:6379'
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
- cache
Run Code Online (Sandbox Code Playgroud)
当我运行时docker-compose -up,出现以下错误。
django.db.utils.OperationalError: (1156, 'Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory') …Run Code Online (Sandbox Code Playgroud) 我最近在计算机上安装了MySQL,并尝试将RStudio连接到MySQL。我按照书中的说明以及此处的说明进行操作。但是,无论何时使用dbConnect()或src_mysql在中RStudio,我都会收到以下错误消息:
Error in .local(drv, ...) :
Failed to connect to database: Error: Plugin caching_sha2_password could not be loaded: The specified module could not be found
Run Code Online (Sandbox Code Playgroud)
例如,我可能会在Windows中使用命令提示符登录到MySQL
mysql -u username -p
并如下创建数据库
CREATE DATABASE myDatabase;
然后在RStudio中:
library(RMySQL)
db <- dbConnect(MySQL(), dbname = "myDatabase", user = "username",
password = "password", host = "localhost")
Run Code Online (Sandbox Code Playgroud)
而我的回应始终是上面列出的错误消息。
如果需要的话:
sessionInfo()
R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Run Code Online (Sandbox Code Playgroud)