keycloak11 mysql xadatasource 数据源配置

1.将mysql数据库驱动 jar 包复制到 keycaloak 目录 modules\system\layers\base\com\mysql\main 下,

新建文件module.xml 编辑

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<module name="com.mysql" xmlns="urn:jboss:module:1.5">

    <resources>
        <resource-root path="mysql-connector-java-5.1.47.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.servlet.api" optional="true"/>
    </dependencies>
</module>

注意点

(1)截图画红线的目录必须一致

(2)jar包名称一至

2.修改配置文件 路径 keycaloak 目录 standalone\configuration 下 standalone.xml 文件

配置数据库可以参考另一篇文章

https://blog.csdn.net/bubaiyi/article/details/107568908


版权声明:本文为bubaiyi原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。