Просмотр исходного кода

【程序目录】优化安装mysql8.0错误提示

sugar1569 1 год назад
Родитель
Сommit
3b98e57a05

+ 5 - 1
crmeb/public/install/index.php

@@ -171,10 +171,14 @@ switch ($step) {
                 $result = mysqli_query($conn, "SELECT @@global.sql_mode");
                 $result = $result->fetch_array();
                 $version = mysqli_get_server_info($conn);
-                if ($version >= 5.7) {
+                if ($version >= 5.7 && $version < 8.0) {
                     if (strstr($result[0], 'STRICT_TRANS_TABLES') || strstr($result[0], 'STRICT_ALL_TABLES') || strstr($result[0], 'TRADITIONAL') || strstr($result[0], 'ANSI'))
                         exit(json_encode(-2));//数据库配置需要修改
                 }
+                if ($version >= 8.0) {
+                    if (strstr($result[0], 'ONLY_FULL_GROUP_BY'))
+                        exit(json_encode(-22));//数据库配置需要修改
+                }
                 $result = mysqli_query($conn, "select count(table_name) as c from information_schema.`TABLES` where table_schema='$dbName'");
                 $result = $result->fetch_array();
                 if ($result['c'] > 0) {

+ 5 - 0
crmeb/public/install/templates/step3.php

@@ -292,6 +292,11 @@
                             $('#J_install_tip_dbport').html('');
                             $('#J_install_tip_dbname').html('<span for="dbname" generated="true" class="tips_error" >请在mysql配置文件修sql-mode或sql_mode为NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION</span><a href="https://doc.crmeb.com/web/single/crmeb_v4/936" target="_blank">查看文档</a>');
                             return false;
+                        } else if (res == -22) {
+                            $('#J_install_tip_dbhost').html('');
+                            $('#J_install_tip_dbport').html('');
+                            $('#J_install_tip_dbname').html('<span for="dbname" generated="true" class="tips_error" >请关闭ONLY_FULL_GROUP_BY模式</span><a href="https://doc.crmeb.com/web/single/crmeb_v4/936" target="_blank">查看文档</a>');
+                            return false;
                         } else if (res == 1045) {
                             $('#J_install_tip_dbhost').html('');
                             $('#J_install_tip_dbport').html('');

+ 1 - 1
crmeb/public/install/templates/step5.php

@@ -35,7 +35,7 @@ $host = $_SERVER['HTTP_HOST'];
             <a href="<?php echo 'http://'.$host;?>" class="btn mid">进入前台</a>
         </div>
         <div class="admin btn">
-            <a href="<?php echo 'http://'.$host;?>/admin" class="btn btn_submit J_install_btn mid">进入后台</a>
+            <a href="<?php echo 'http://'.$host;?>/admin/login" class="btn btn_submit J_install_btn mid">进入后台</a>
         </div>
       </div>
     </div>