"我又遇到问题了。。。我之前的是 2.9.7 版本的,现在下了最新的 war 包来部署, mysql 版本 root@iZuf6a0oa5iduhj9h0jk4vZ:/usr/local/tomcat/webapps/solo/WEB-INF/classes# mysql --version mysql Ver 14.1 .."

Solo 初始化问题

我又遇到问题了。。。我之前的是 2.9.7 版本的,现在下了最新的 war 包来部署,

mysql 版本

root@iZuf6a0oa5iduhj9h0jk4vZ:/usr/local/tomcat/webapps/solo/WEB-INF/classes# mysql --version

mysql  Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using  EditLine wrapper

latke.prop

#### Server ####

# Browser visit protocol
serverScheme=http
serverHost=zhangchensong.top
serverPort=8080

#### Runtime Mode ####
#runtimeMode=DEVELOPMENT
runtimeMode=PRODUCTION

local.prop

#### MySQL runtime ####

runtimeDatabase=MYSQL
jdbc.username=zhangcs
jdbc.password=qaqaqa136045033
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.URL=jdbc:mysql://localhost:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC

库的

mysql> show create database solo;

+----------+------------------------------------------------------------------+
| Database | Create Database                                                  |
+----------+------------------------------------------------------------------+
| solo     | CREATE DATABASE `solo` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+----------+------------------------------------------------------------------+

点击 GitHub 开始试用会自动销毁?

日志

[INFO ]-[2019-04-12 17:27:21]-[org.b3log.solo.SoloServletListener:97]: Solo is booting [pid=13550, runtimeDatabase=MYSQL, runtimeMode=PRODUCTION, jdbc.username=zhangcs, jdbc.URL=jdbc:mysql://localhost:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC]

[INFO ]-[2019-04-12 17:27:21]-[com.zaxxer.hikari.HikariDataSource:110]: HikariPool-1 - Starting...
[INFO ]-[2019-04-12 17:27:22]-[com.zaxxer.hikari.HikariDataSource:123]: HikariPool-1 - Start completed.
[WARN ]-[2019-04-12 17:27:22]-[org.b3log.solo.service.InitService:164]: Solo has not been initialized, please open your browser to init Solo
[ERROR]-[2019-04-12 17:27:42]-[org.b3log.latke.repository.jdbc.JdbcRepository:490]: Query failed
java.sql.SQLSyntaxErrorException: Unknown column 'userGitHubId' in 'where clause'

        
[ERROR]-[2019-04-12 17:27:42]-[org.b3log.solo.service.UserQueryService:79]: Gets a user by GitHub id [37106292] failed
org.b3log.latke.repository.RepositoryException: java.sql.SQLSyntaxErrorException: Unknown column 'userGitHubId' in 'where clause'

Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'userGitHubId' in 'where clause'

        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:975)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1025)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
        at org.b3log.latke.repository.jdbc.util.JdbcUtil.queryJson(JdbcUtil.java:159)
        at org.b3log.latke.repository.jdbc.util.JdbcUtil.queryJsonArray(JdbcUtil.java:130)
        at org.b3log.latke.repository.jdbc.JdbcRepository.get(JdbcRepository.java:486)
        ... 60 more
[INFO ]-[2019-04-12 17:27:42]-[org.b3log.solo.service.InitService:465]: Initialized statistic
[ERROR]-[2019-04-12 17:27:42]-[org.b3log.latke.repository.jdbc.JdbcRepository:153]: Add failed
java.sql.SQLException: Incorrect string value: '\xE4\xB8\x80\xE6\xAC\xBE...' for column 'optionValue' at row 1

[ERROR]-[2019-04-12 17:27:42]-[org.b3log.solo.service.InitService:236]: Initializes Solo failed

org.b3log.latke.repository.RepositoryException: java.sql.SQLException: Incorrect string value: '\xE4\xB8\x80\xE6\xAC\xBE...' for column 'optionValue' at row 1

Caused by: java.sql.SQLException: Incorrect string value: '\xE4\xB8\x80\xE6\xAC\xBE...' for column 'optionValue' at row 1

        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:975)
        at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:392)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
        at org.b3log.latke.repository.jdbc.util.JdbcUtil.executeSql(JdbcUtil.java:91)
        at org.b3log.latke.repository.jdbc.JdbcRepository.add(JdbcRepository.java:150)
        ... 59 more
[INFO ]-[2019-04-12 17:27:44]-[com.zaxxer.hikari.HikariDataSource:350]: HikariPool-1 - Shutdown initiated...
[INFO ]-[2019-04-12 17:27:44]-[com.zaxxer.hikari.HikariDataSource:352]: HikariPool-1 - Shutdown completed.
[INFO ]-[2019-04-12 17:27:44]-[org.b3log.solo.SoloServletListener:152]: Destroyed the context

  • Solo

    Solo 是一款小而美的开源博客系统,专为程序员设计。

    Solo 有着非常活跃的社区,可将文章作为帖子推送到社区,来自社区的回帖将作为博客评论进行联动。

    这是一种全新的网络社区体验,让热爱记录和分享的你不再感到孤单!
    具体细节请浏览 B3log 构思

    657 引用 • 4984 回帖 • 710 关注
  • Q&A

    提问之前请先看一下这篇文章 《提问的智慧》精读注解版,好的问题比好的答案更有价值。

    1043 引用 • 6653 回帖 • 594 关注
4 回帖   
请输入回帖内容...
  • 88250

    v3 以前不支持跨版本升级,得一个一个版本先升级到 v3.0.0,再用最新版部署。升级操作请参考版本发布帖。

    1 回复
  • zhangchensong        

    谢谢!
    我删除了在 2.9.7 版本时建的库,重新建了库以后已经部署成功了

    1 回复
  • 88250      

    客气,还遇到问题的话随时艾特我 😄

  • 88250

    对了,既然是新搭建的话建议用 Docker,这样后面发布新版本的话可以做到自动升级部署。