如何解决访问Keycloak的H2数据库时,无效的用户名/密码
我试图按照指南here直接查看我的H2数据库。
执行命令时:java -cp $jar org.h2.tools.Console -url "$url" -user sa -password sa
我收到以下异常Exception in thread "main" org.h2.jdbc.JdbcSQLException: Wrong user name or password [28000-193]
这似乎相对简单,但是我似乎无法弄清楚我的凭据。我正在通过docker映像在本地运行keycloak 7.0.0,并且我还没有故意修改有关数据库的任何内容。到目前为止,我尝试了sa,empty和keycloak凭据的排列,但均未成功。
是否有任何方法可以获取/设置/创建此数据库的一组凭据?
解决方法
我认为现成的h2数据库的默认密码为“”(空)。
尽管如此,您还可以从the subsystem configuration files查找或配置数据源。
您应该找到类似的东西。
import React,{ useState,useEffect } from 'react'
import { Col,InputGroup,Input,InputGroupAddon,Button,Alert,Row } from 'reactstrap';
import { connect } from 'react-redux';
import { ADD_TODO,UPDATE_TODO,todoNodeStructure} from './todoSlice';
import { Typeahead,TypeaheadMenu } from 'react-bootstrap-typeahead';
import { RootState } from '.';
const InputForTodo = React.memo(function (props : any = {editedTitle : 'cad'}) {
const [toDoTitle,updateToDoTitle] = useState(props.editedTitle ? props.editedTitle : '');
const [alertToDo,toggleToDoAlertVisibility] = useState(false);
console.log(toDoTitle)
useEffect(() => {
updateToDoTitle(props.editedTitle ? props.editedTitle : '');
},[props.editedTitle])
return (
<Row>
<Col xs="4">
<Typeahead allowNew options={props.todos} defaultSelected={[toDoTitle]} onChange={(selected) => updateToDoTitle(selected)} inputProps={{'id' : props.type === "EDIT" ? "edit_todo_input" : "add_todo_input",'value' : 'nince' }} disabled={props.type === "EDIT" ? true : false} labelKey={(todo : todoNodeStructure) => `${todo.title}`} placeholder={props.type === "ADD" ? "What do you want to do?" : "" } onKeyDown={(e: any) => e.key === 'Enter' && toDoTitle.length >= 5 ? props.type ==="ADD" ? props.ADD_TODO({id: props.todos.length + 1,title : toDoTitle,completed : false}) && updateToDoTitle('') : props.UPDATE_TODO({id: props.id,title : toDoTitle}) && (e.target.disabled = true) && props.updateSelectedTitle('') && props.updateId(0): console.log(e.key)} onInputChange={(text : string,e : Event) => { updateToDoTitle(text); text.length < 5 ? toggleToDoAlertVisibility(true) : toggleToDoAlertVisibility(false)}}></Typeahead>
{/* <TypeaheadMenu options={props.todos} id="c" labelKey={(todo : todoNodeStructure) => `${todo.title}`}></TypeaheadMenu> */}
<InputGroup>
{/* <Input type="text" disabled={props.type === "EDIT" ? true : false} id={props.type === "EDIT" ? "edit_todo_input" : "add_todo_input"} onKeyPress={(e: any) => e.key === 'Enter' && toDoTitle.length >= 5 ? props.type ==="ADD" ? props.ADD_TODO({id: props.todos.length + 1,title : toDoTitle}) && (e.target.disabled = true) && props.updateSelectedTitle('') && props.updateId(0): console.log(e.key)} value={ toDoTitle } onChange={(e) => { updateToDoTitle(e.target.value); e.target.value.length < 5 ? toggleToDoAlertVisibility(true) : toggleToDoAlertVisibility(false)}}/> */}
{/* <InputGroupAddon addonType="append">{props.type === "ADD" ? <Button color="primary" size="sm" id="todo_add_button" disabled={ toDoTitle.length < 5 ? true : false} onClick={() => { props.ADD_TODO({id: props.todos.length + 1,completed : false}); updateToDoTitle('') }}>Add</Button>: <Button color="primary" size="sm" id="edit_todo_button" disabled={toDoTitle.length < 5 || props.todos.find((todo : todoNodeStructure) => todo.id === props.id)?.title === toDoTitle ? true : false} onClick={() => {props.UPDATE_TODO({id: props.id,title : toDoTitle}); (document.getElementById('edit_todo_button') as HTMLButtonElement).disabled = true; props.updateSelectedTitle(''); props.updateId(0)}}>Save</Button>}</InputGroupAddon> */}
</InputGroup>
{toDoTitle}
</Col>
<Col>
<Alert isOpen={alertToDo} color="info">Length of the field should be greater than 5</Alert>
</Col>
</Row>
)
})
const mapStateToProps = (state : RootState) => ({
lastTodoId : state.lastTodoId
})
const mapDispatchToProps = { ADD_TODO,UPDATE_TODO }
export default connect(mapStateToProps,mapDispatchToProps)(InputForTodo);
Keycloak依赖于Widlfly which documentation gives more info about database configuration。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。