宿主机原本已经安装了mysql 8.0.31(docker),安装的命令如下
docker run --name my_mysql --network my_network \
--ip 192.168.1.11 -p 3306:3306 \
-e MYSQL_ROOT_PASSWORD="CEshimima@" \
-e TZ="Asia/Shanghai" \
-v /home/mysql/data:/var/lib/mysql \
-v /home/mysql/log:/var/log/mysql \
-v /home/mysql/config/my.cnf:/etc/my.cnf \
-d mysql
在my.cnf中添加了default-authentication-plugin=mysql_native_password,其他设置不变。现在使用docker安装halo失败,docker命令为
docker run --name my_halo --network my_network \
--ip 192.168.1.66 -p 8090:8090 \
-e TZ="Asia/Shanghai" \
-e SPRING_R2DBC_URL=r2dbc:pool:mysql://192.168.1.11:3306/halo \
-e SPRING_R2DBC_USERNAME=root\
-e SPRING_R2DBC_PASSWORD=CEshimima@ \
-e SPRING_SQL_INIT_PLATFORM=mysql \
-e HALO_EXTERNAL_URL=http://localhost:8090/ \
-e HALO_SECURITY_INITIALIZER_SUPERADMINUSERNAME=admin\
-e HALO_SECURITY_INITIALIZER_SUPERADMINPASSWORD=Halo@Halo \
-v /home/halo:/root/.halo2 \
-it -d halohub/halo:2.0.2
报错信息如下:
thub.jasync.sql.db.exceptions.BufferNotFullyConsumedException: Buffer was not fully consumed by decoder, 21 bytes to read, decoder is AuthenticationSwitchRequestDecoder and message is AuthenticationSwitchRequest
at com.github.jasync.sql.db.mysql.codec.MySQLFrameDecoder.doDecoding(MySQLFrameDecoder.kt:215) ~[jasync-mysql-2.1.7.jar:na]
at com.github.jasync.sql.db.mysql.codec.MySQLFrameDecoder.handleCommonFlow(MySQLFrameDecoder.kt:173) ~[jasync-mysql-2.1.7.jar:na]
at com.github.jasync.sql.db.mysql.codec.MySQLFrameDecoder.decode(MySQLFrameDecoder.kt:99) ~[jasync-mysql-2.1.7.jar:na]
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529) ~[netty-codec-4.1.85.Final.jar:4.1.85.Final]
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468) ~[netty-codec-4.1.85.Final.jar:4.1.85.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[netty-codec-4.1.85.Final.jar:4.1.85.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.85.Final.jar:4.1.85.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.85.Final.jar:4.1.85.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.85.Final.jar:4.1.85.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.85.Final.jar:4.1.85.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.85.Final.jar:4.1.85.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.85.Final.jar:4.1.85.Final]
搜了一下好像跟数据库驱动有关,但时没找到其他解决办法了。
跟各位分享一下遇到的问题,看有没有人也遇到过。(顺便也请大家帮忙看看是不是我docker命令写错了……自己已经有点上头了,看不出问题😂)主要还是希望部署之后halo能使用已有的数据库而不用单独起一个容器了。