站帮网 发表于 2026-4-25 14:45:32

DISCUZX3.5升级DISCUZX5.0结果中途报错,如何排除故障修复 New

一开始是有些错误,如超过了 MySQL 默认 767 字节限制,用ai解决了,进行到图二就解决不了了,也不知道什么原因中止了,这个论坛是以前5d6d独立出来的,可能数据表问题比较多。


“正在初始化数据表中的数据 pre_restful_source ... 成功数据库数据初始化完成”








以下这种是编码问题,配合AI,用旧表改名、sql全新建表、把数据安全导入解决了。


javascript



▼ 展开



以下是数据库主键冲突的“索引”问题,也是用以上方法解决:


javascript



▼ 展开



解决办法的SQL三部曲:


javascript



▼ 展开



升级discuz!x5过程中 ,有个错误(索引名 loginname 已经存在,不能重复创建)也是稀里糊涂不知道是怎么解决的:


javascript



▼ 展开



但是到了这一步,怎么就解决不了,也不知道什么原因。








我知道答案 回答被采纳将会获得1 贡献 已有11人回答

站帮网 发表于 2026-4-25 14:46:23

你这个界面哪儿来的?到X5版本的升级界面是黑色的。你自己找好程序再说吧。官方的 X3.5>X5 升级程序可以反复执行不出错

余赚网 发表于 2026-4-25 14:46:39

monkeye 发表于 2026-4-8 20:56
你这个界面哪儿来的?到X5版本的升级界面是黑色的。你自己找好程序再说吧。官方的 X3.5>X5 升级程序可以反 ...                        可能是我截图不全的原因
       

                                       
                           
            
      
   

                        我是在官方链接(https://www.dismall.com/thread-28146-1-1.html )里的下载链接:https://download.discuz.vip/redirect/?X5.0 下载的。
       

                        根据chrome下载显示的URL是https://foruda.gitee.com/attach_file/1775001798050194992/discuz_x5.0_20260401.zip
       

                        我严格按照【X5 安装升级注意事项】https://www.dismall.com/thread-28083-1-1.html的流程
       

                                          1、确保您的旧版本 Discuz! 必须为 X3.5 版本,如不满足版本要求请先升级到此版本;2、确保 UCenter 和 Discuz! 部署在一个数据库中;3、确保您已备份了数据库和程序文件,将旧版本程序文件移动到其他目录下;4、将旧版本的配置文件 config/config_global.php、config/config_ucenter.php 复制到当前新版本的 config/ 目录中;5、点击“下一步”开始升级;            
                                       
                                       
         

.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.ce-paragraph {    line-height: 1.6em;    outline: none;    text-indent: 2em;    font-size: 16px;}.ce-paragraph--right {    text-align: right;}.ce-paragraph--center {    text-align: center;}.ce-paragraph--left {    text-align: left;}.ce-paragraph--justify {    text-align: justify;}.ce-paragraph-text-indent {    text-align: justify;}.ce-paragraph:empty::before{content: attr(data-placeholder);color: #707684;font-weight: normal;opacity: 0;}/** Show placeholder at the first paragraph if Editor is empty */.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {opacity: 1;}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {opacity: 0;}.ce-paragraph p:first-of-type{    margin-top: 0;}.ce-paragraph p:last-of-type{    margin-bottom: 0;}.svg-icon {    width: 1em;    height: 1em;}.svg-icon path,.svg-icon polygon,.svg-icon rect {    fill: #4691f6;}.svg-icon circle {    stroke: #4691f6;    stroke-width: 1;}.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.image-tool {--bg-color: #cdd1e0;--front-color: #388ae5;--border-color: #e8e8eb;}.image-tool__image {    border-radius: 3px;    overflow: hidden;    margin-bottom: 10px;}.image-tool__image-picture {      max-width: 100%;      vertical-align: bottom;      display: block;      margin-left: auto;      margin-right: auto;    }.image-tool__image-preloader {      width: 50px;      height: 50px;      border-radius: 50%;      background-size: cover;      margin: auto;      position: relative;      background-color: #cdd1e0;      background-position: center center;    }.image-tool__image-preloader::after {      content: "";      position: absolute;      z-index: 3;      width: 60px;      height: 60px;      border-radius: 50%;      border: 2px solid #cdd1e0;      border-top-color: #388ae5;      left: 50%;      top: 50%;      margin-top: -30px;      margin-left: -30px;      animation: image-preloader-spin 2s infinite linear;      box-sizing: border-box;      }.image-tool__caption::before {      position: absolute !important;      content: attr(data-placeholder);      color: #707684;      font-weight: normal;      display: none;    }.image-tool__caption:empty::before {      display: block;      }.image-tool__caption:empty:focus::before {      display: none;      }.image-tool--empty .image-tool__image {      display: none;    }.image-tool--empty .image-tool__caption, .image-tool--loading .image-tool__caption {      display: none;    }.image-tool .cdx-button {    display: flex;    align-items: center;    justify-content: center;}.image-tool .cdx-button svg {      height: auto;      margin: 0 6px 0 0;    }.image-tool--filled .cdx-button {      display: none;    }.image-tool--filled .image-tool__image-preloader {      display: none;      }.image-tool--loading .image-tool__image {      min-height: 200px;      display: flex;      border: 1px solid #e8e8eb;      background-color: #fff;    }.image-tool--loading .image-tool__image-picture {      display: none;      }.image-tool--loading .cdx-button {      display: none;    }/**   * Tunes   * ----------------   */.image-tool--withBorder .image-tool__image {      border: 1px solid #e8e8eb;    }.image-tool--withBackground .image-tool__image {      padding: 15px;      background: #cdd1e0;    }.image-tool--withBackground .image-tool__image-picture {      max-width: 60%;      margin: 0 auto;      }.image-tool--stretched .image-tool__image-picture {      width: 100%;      }.image-tool__caption {                text-align: center;                font-size: 14px;                color: #a3a3a3;        }@keyframes image-preloader-spin {0% {    transform: rotate(0deg);}100% {    transform: rotate(360deg);}}.ce-block {    margin-bottom: 20px;}.ce-block__content, .ce-toolbar__content {    margin-left: auto;    margin-right: auto;}.cdx-quote {    position: relative;    background-color: #f8f8f8;    padding: 24px!important;    margin: 0px;    border-radius: 12px;    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);    overflow: hidden;}.quote-background-icon {    position: absolute;    top: 10px;    right: 10px;    opacity: 0.2;    z-index: 1;}.cdx-quote__text {    min-height: 30px;    margin-bottom: 10px;    font-size: 16px;    line-height: 1.5;    color: #333;}.cdx-quote__caption {    padding: 10px 20px 0px 20px;    font-size: 14px;    color: #777;}.cdx-quote__caption-left {    text-align: left;}.cdx-quote__caption-center {    text-align: center;}.cdx-quote__caption-right {    text-align: right;}.cdx-quote ::before {    position: absolute;    content: attr(data-placeholder);    color: #bbb;    font-weight: normal;    opacity: 0;}.cdx-quote :empty::before {    opacity: 1;}.cdx-quote :empty:focus::before {    opacity: 0;}.cdx-quote-settings {    display: flex;}.cdx-quote-settings .cdx-settings-button {    width: 50%;}.inline-code {background: rgba(250, 239, 240, 0.78);color: #b44437;padding: 3px 4px;border-radius: 5px;margin: 0 1px;font-family: inherit;font-size: 0.86em;font-weight: 500;letter-spacing: 0.3px;}

小冰 发表于 2026-4-25 14:47:11

这就不是截图不全的事情,你看主题帖里的截图和你回帖的截图,配色都不是同一个

小冰 发表于 2026-4-25 14:47:41

湖中沉 发表于 2026-4-8 21:42
这就不是截图不全的事情,你看主题帖里的截图和你回帖的截图,配色都不是同一个 ...                        为了避免是使用云数据库的兼容性问题,我本地phpstudy重装DZX3.5导入数据库,再到https://www.dismall.com/thread-28146-1-1.html下载新版,按文档升级X5.0,也是到这一步:
       

                        正在初始化数据表中的数据 pre_restful_source ... 成功
       

                        数据库数据初始化完成
       

                                       
                           
            
      
   

.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.ce-paragraph {    line-height: 1.6em;    outline: none;    text-indent: 2em;    font-size: 16px;}.ce-paragraph--right {    text-align: right;}.ce-paragraph--center {    text-align: center;}.ce-paragraph--left {    text-align: left;}.ce-paragraph--justify {    text-align: justify;}.ce-paragraph-text-indent {    text-align: justify;}.ce-paragraph:empty::before{content: attr(data-placeholder);color: #707684;font-weight: normal;opacity: 0;}/** Show placeholder at the first paragraph if Editor is empty */.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {opacity: 1;}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {opacity: 0;}.ce-paragraph p:first-of-type{    margin-top: 0;}.ce-paragraph p:last-of-type{    margin-bottom: 0;}.svg-icon {    width: 1em;    height: 1em;}.svg-icon path,.svg-icon polygon,.svg-icon rect {    fill: #4691f6;}.svg-icon circle {    stroke: #4691f6;    stroke-width: 1;}.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.image-tool {--bg-color: #cdd1e0;--front-color: #388ae5;--border-color: #e8e8eb;}.image-tool__image {    border-radius: 3px;    overflow: hidden;    margin-bottom: 10px;}.image-tool__image-picture {      max-width: 100%;      vertical-align: bottom;      display: block;      margin-left: auto;      margin-right: auto;    }.image-tool__image-preloader {      width: 50px;      height: 50px;      border-radius: 50%;      background-size: cover;      margin: auto;      position: relative;      background-color: #cdd1e0;      background-position: center center;    }.image-tool__image-preloader::after {      content: "";      position: absolute;      z-index: 3;      width: 60px;      height: 60px;      border-radius: 50%;      border: 2px solid #cdd1e0;      border-top-color: #388ae5;      left: 50%;      top: 50%;      margin-top: -30px;      margin-left: -30px;      animation: image-preloader-spin 2s infinite linear;      box-sizing: border-box;      }.image-tool__caption::before {      position: absolute !important;      content: attr(data-placeholder);      color: #707684;      font-weight: normal;      display: none;    }.image-tool__caption:empty::before {      display: block;      }.image-tool__caption:empty:focus::before {      display: none;      }.image-tool--empty .image-tool__image {      display: none;    }.image-tool--empty .image-tool__caption, .image-tool--loading .image-tool__caption {      display: none;    }.image-tool .cdx-button {    display: flex;    align-items: center;    justify-content: center;}.image-tool .cdx-button svg {      height: auto;      margin: 0 6px 0 0;    }.image-tool--filled .cdx-button {      display: none;    }.image-tool--filled .image-tool__image-preloader {      display: none;      }.image-tool--loading .image-tool__image {      min-height: 200px;      display: flex;      border: 1px solid #e8e8eb;      background-color: #fff;    }.image-tool--loading .image-tool__image-picture {      display: none;      }.image-tool--loading .cdx-button {      display: none;    }/**   * Tunes   * ----------------   */.image-tool--withBorder .image-tool__image {      border: 1px solid #e8e8eb;    }.image-tool--withBackground .image-tool__image {      padding: 15px;      background: #cdd1e0;    }.image-tool--withBackground .image-tool__image-picture {      max-width: 60%;      margin: 0 auto;      }.image-tool--stretched .image-tool__image-picture {      width: 100%;      }.image-tool__caption {                text-align: center;                font-size: 14px;                color: #a3a3a3;        }@keyframes image-preloader-spin {0% {    transform: rotate(0deg);}100% {    transform: rotate(360deg);}}.inline-code {background: rgba(250, 239, 240, 0.78);color: #b44437;padding: 3px 4px;border-radius: 5px;margin: 0 1px;font-family: inherit;font-size: 0.86em;font-weight: 500;letter-spacing: 0.3px;}

月落秋水 发表于 2026-4-25 14:48:14

myes 发表于 2026-4-8 22:16
为了避免是使用云数据库的兼容性问题,我本地phpstudy重装DZX3.5导入数据库,再到https://www.dismall.co ...                        你这界面上看就不是官方的程序,请认准官方的程序。文件用完全喽。
       

.ce-block {    margin-bottom: 20px;}.ce-block__content,.ce-toolbar__content {        /* max-width:calc(100% - 50px) */        margin-left: auto;    margin-right: auto;}.ce-paragraph {    line-height: 1.6em;    outline: none;    text-indent: 2em;    font-size: 16px;}.ce-paragraph--right {    text-align: right;}.ce-paragraph--center {    text-align: center;}.ce-paragraph--left {    text-align: left;}.ce-paragraph--justify {    text-align: justify;}.ce-paragraph-text-indent {    text-align: justify;}.ce-paragraph:empty::before{content: attr(data-placeholder);color: #707684;font-weight: normal;opacity: 0;}/** Show placeholder at the first paragraph if Editor is empty */.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {opacity: 1;}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {opacity: 0;}.ce-paragraph p:first-of-type{    margin-top: 0;}.ce-paragraph p:last-of-type{    margin-bottom: 0;}.svg-icon {    width: 1em;    height: 1em;}.svg-icon path,.svg-icon polygon,.svg-icon rect {    fill: #4691f6;}.svg-icon circle {    stroke: #4691f6;    stroke-width: 1;}.inline-code {background: rgba(250, 239, 240, 0.78);color: #b44437;padding: 3px 4px;border-radius: 5px;margin: 0 1px;font-family: inherit;font-size: 0.86em;font-weight: 500;letter-spacing: 0.3px;}

霸王别姬 发表于 2026-4-25 14:48:38

大哥,我就问你,你第一次回帖的时候的截图你看到没?那是黑色的,你这截图咋又变色了?X5就不是这个配色啊

知行社区 发表于 2026-4-25 14:49:07

"一开始是有些错误,如超过了 MySQL 默认 767 字节限制"

3.4升级到3.5的时候 可能会有这种报错;X3.5升级X5 不应该会有这种报错的

你确定是 X3.5 升级到X5吗?

ROBOT 发表于 2026-4-25 14:49:35

你帖子的第一张图是升级 x3.5的吧 先按这个修复问题https://www.dismall.com/thread-14718-1-1.html
成功后再升级 x5哦

站帮网 发表于 2026-4-25 14:49:45

3.5版本有问题,需要先处理3.5问题后在升级看下。
页: [1]
查看完整版本: DISCUZX3.5升级DISCUZX5.0结果中途报错,如何排除故障修复 New