Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of installing Times wrong run_sql_error by Discuz

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How does Discuz solve the problem of installing Times wrong run_sql_error? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

This paper realizes the function.

Solve the problem of installing discuz error run_sql_error in MySQL8.0

If you want to see the solution directly, go directly to the problem solving list.

Problem environment

VMware virtual machine

Centos7.3

PHP7.0

MySQL8.0

NGINX1.14

Discuz3.4

Problem reduction

The local environment is PHP5.6+MySQL5.6. There is no problem installing discuz.

The following problem occurred on the centos of the virtual machine. The table of MySQL could not be created and an error was reported when installing.

Host uses Xsheel and Ftp

Because it is not convenient to take screenshots on the centos terminal, all the following environment changes will be operated on the xshell and accessed directly on the host machine.

About configuring how to connect to virtual machines using xsheel

The connection mode is NAT, and tools is already installed

Use the xsheel connection to view the ip address in the virtual machine using ifconfig

Then to connect, you need to enter the account password, which is your virtual machine account password.

If the connection is successful, you can enter PHP-v to view the PHP version information.

Another is ftp, which uses the host's ftp to connect to the virtual machine because it needs to transfer something. Similarly, enter the ip address and the port is 22

After a successful connection, you can get the files of the virtual machine.

Solve the problem

The root of this problem lies in the version of MySQL. The version supported by discuz is PHP5.3. But all database files are created on MySQL5.5. So it will cause the character set garbled.

At this time we open / etc/my.ini, this is some of the default configuration, the following mysqldump do not worry about, which is the previous configuration of MySQL master-slave replication to configure data configuration.

Add the following code to this file

Init_connect='SET NAMES utf8'default-storage-engine=INNODBcharacter-set-server=utf8collation-server=utf8_general_cidefault_authentication_plugin=mysql_native_password

All storage engines in mysql8.0 are innodb, so it is directly set to innodb by default.

Character set is set to utf8

Default_authentication_plugin modify password authentication plug-in

After the above configuration, let's test it.

test

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

Click OK, and there will be no error.

Just visit the forum.

Looking at the database

The total number of tables checked is 292 tables

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

After reading the above, have you mastered how Discuz solves the problem of installing the wrong run_sql_error in the Times? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report