微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在hawkBit中设置mysql时,字段列表中的MySQL未知列“sha256_hash”

如何解决在hawkBit中设置mysql时,字段列表中的MySQL未知列“sha256_hash”

我想用 hawkBit 更新服务器设置 MysqL 数据库。 要启用 MysqL,我已完成以下步骤:

sudo MysqL -u root
*Welcome to the MariaDB monitor.  Commands end with ; or \g.*
*Your MariaDB connection id is 31*
*Server version: 10.1.47-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04*
*copyright (c) 2000,2018,Oracle,MariaDB Corporation Ab and others.*
*Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.*

MariaDB [(none)]> USE MysqL;
*Reading table information for completion of table and column names*
*You can turn off this feature to get a quicker startup with -A*
*Database changed*
MariaDB [MysqL]> CREATE USER 'test'@'localhost' IDENTIFIED BY '123456a@';
*Query OK,0 rows affected (0.00 sec)*
*MariaDB [MysqL]> UPDATE user SET authentication_string=password('123456a@') where user='test';*
*Query OK,0 rows affected (0.00 sec)*
*Rows matched: 1  Changed: 0  Warnings: 0*

MariaDB [MysqL]> GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost';
*Query OK,0 rows affected (0.00 sec)*

MariaDB [MysqL]> UPDATE user SET plugin='MysqL_native_password' WHERE User='test';
*Query OK,1 row affected (0.01 sec)*
*Rows matched: 1  Changed: 1  Warnings: 0*

MariaDB [MysqL]> FLUSH PRIVILEGES;
*Query OK,0 rows affected (0.00 sec)*

MariaDB [MysqL]> CREATE DATABASE hawkbit;
*Query OK,1 row affected (0.00 sec)*

MariaDB [MysqL]> ALTER DATABASE hawkbit COLLATE latin1_bin;
Query OK,1 row affected (0.00 sec)

MariaDB [MysqL]> grant all privileges on hawkbit.* TO 'test'@'localhost' identified by '123456a@';
*Query OK,0 rows affected (0.01 sec)*

MariaDB [(none)]> exit
*Bye*

sudo service MysqL restart

在hawkbit-runtime/hawkbit-update-server/pom.xml中添加以下代码

<dependency>
    <groupId>org.mariadb.jdbc</groupId>
    <artifactId>mariadb-java-client</artifactId>
    <scope>compile</scope>
</dependency>

将以下代码覆盖到hawkbit-runtime/hawkbit-update-server/src/main/resources/application-MysqL.properties:

spring.jpa.database=MysqL
spring.datasource.url=jdbc:MysqL://localhost:3306/hawkbit
spring.datasource.username=test
spring.datasource.password=123456a@
spring.datasource.driverClassName=org.mariadb.jdbc.Driver

重建并运行:

cd hawkbit
mvn clean install
java -jar ./hawkbit-runtime/hawkbit-update-server/target/hawkbit-update-server-0.3.0-SNAPSHOT.jar --spring.profiles.active=MysqL

在启用 MysqL 的情况下成功运行 hawkBit 后,我​​看到很多与 MysqL 相关的错误。 例如:

UnkNown column 'sha256_hash' in 'field list'

我认为该数据库与 hawkbit 更新服务器不兼容,因为它没有任何表。因此,我期待任何成功使用 hawkbit 设置 MysqL 以及创建数据库表的确切命令的人的经验。

谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。