search
HomeCMS TutorialDiscuzHow Discuz solves the error run_sql_error during installation

The functions implemented in this article

Solution to the run_sql_error error reported by discuz when installing MySQL8.0

If you want to see the solution results directly, go directly to the problem solving directory

Problem environment

  1. VMware virtual machine

  2. ##Centos7.3

  3. PHP7.0

  4. MySQL8.0

  5. NGINX1.14

  6. Discuz3.4


Problem restoration


The local environment is PHP5.6 MySQL5.6 without any problems when installing discuz.


The following problem occurs on the centos of the virtual machine. The MySQL table cannot be created and the installation error is reported.

How Discuz solves the error run_sql_error during installation

The host uses Xsheel and Ftp


Due to the inconvenience of taking screenshots from the centos terminal, all environment modifications below will be performed on xshell and accessed directly on the host machine.

About configuring how to use xsheel to connect to a virtual machine

The connection mode is NAT, and the tools have been installed

How Discuz solves the error run_sql_error during installation

Use xsheel to connect, in The virtual machine uses ifconfig to check the IP address


How Discuz solves the error run_sql_error during installation

and then connects. You need to enter the account password. The account password is your virtual machine account password


How Discuz solves the error run_sql_error during installation

The connection looks like the following if the connection is successful. You can enter PHP -v to view the PHP version information

How Discuz solves the error run_sql_error during installation

The other one is ftp, because it is needed To transfer something, I also used the host's ftp to connect to the virtual machine. In the same way, enter the IP address and the port is 22

How Discuz solves the error run_sql_error during installation

After the connection is successful, you can obtain the virtual machine file

How Discuz solves the error run_sql_error during installation

Solution to the problem


The root of this problem is the MySQL version. The version supported by discuz is PHP5.3. But all database files are created on MySQL5.5. Therefore, the character set will be garbled.


At this time, we open /etc/my.ini. This is the default configuration. Don’t worry about the mysqldump below. That is the situation where MySQL master-slave replication was configured before to have data. configured.

How Discuz solves the error run_sql_error during installation

Add the following code to this file

init_connect='SET NAMES utf8'

default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci

default_authentication_plugin=mysql_native_password

How Discuz solves the error run_sql_error during installation

All storage engines in mysql8.0 are innodb , so the default setting here is innodb

The character set is set to utf8

default_authentication_pluginModify the password verification plug-in

After the above configuration, let’s test it

Test


Enter http://192.168.254.130/forum/install/index.php in the address bar, and then continue to the next step. Enter your database account password here

How Discuz solves the error run_sql_error during installation

Click to confirm, and there will be no error report

How Discuz solves the error run_sql_error during installation

Just visit the forum OK

How Discuz solves the error run_sql_error during installation

Viewing the database

How Discuz solves the error run_sql_error during installation

The number of tables viewed is 292 in total


How Discuz solves the error run_sql_error during installation

Then go to the locally installed database and check that the number is also 292

How Discuz solves the error run_sql_error during installation

Summary


The above is the solution for discuz's installation error in MySQL8.0. Although it only requires a few lines of configuration, it cannot be solved in a short time.

The above is the detailed content of How Discuz solves the error run_sql_error during installation. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.