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

This commit is contained in:
sugar1569 2024-05-25 16:16:48 +08:00
parent af17f0ca10
commit 3b98e57a05
3 changed files with 11 additions and 2 deletions

View File

@ -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) {

View File

@ -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('');

View File

@ -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>