问题描述
我想用 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 (将#修改为@)