今天把网站换了台服务器结果发现UCenter打开时提示UCenter info: Can not connect to MySQL server 了,但通信是没有问题,只是注册时提示错误,这个不用说就是数据库配置文章的问题,
修改下Discuz的配置文件罗。找到
安装目录/config/config_global.php 及 安装目录/uc_server/data/config.inc.php修改。
OK,没有出现错误了,但是不管是点击注册,还是登录,都会出现"内部错误,无法显示此内容",然后再点击这个错误提示,又出现上面的"UCenter info:Can not connect to MySQL server。不能连接数据库了。
蛮奇怪,但是通过http://localhost/bbs/uc_server/登录UCenter是没问题的,看到应用设置里面也是显示通信成功的,我下载数据之后也进入这里修改了域名绑定的了。
主要错误:
UCenter info: Can not connect to MySQL server
Error:
Errno:0
需要修改的文件是以下三个:
安装目录/config/config_global.php
安装目录/config/config_ucenter.php
安装目录/uc_server/data/config.inc.php
具体怎么改我给个例子
config_global
// ------------------ CONFIG DB ------------------- // $_config['db']['1']['dbhost'] = 'localhost'; $_config['db']['1']['dbuser'] = 'a064322111'; $_config['db']['1']['dbpw'] = 321423432; $_config['db']['1']['dbcharset'] = 'utf8'; $_config['db']['1']['pconnect'] = '0'; $_config['db']['1']['dbname'] = 'a064322111'; $_config['db']['1']['tablepre'] = 'pre_';
config_ucenter
<?php define('UC_CONNECT', 'mysql'); define('UC_DBHOST', 'localhost'); define('UC_DBUSER', 'a064322111'); define('UC_DBPW', '321423432'); define('UC_DBNAME', 'a064322111'); define('UC_DBCHARSET', 'utf8'); define('UC_DBTABLEPRE', '`a064322111`.pre_ucenter_'); define('UC_DBCONNECT', 0); define('UC_CHARSET', 'utf-8'); define('UC_KEY', 'VdMcG6D4Pdx1S1H2Acfab6o3j4t5x5xfV7vaTbg5I17dE1Y3k0ueh6EaQ3b8EaBb'); define('UC_API', 'http://www.phprm.com / uc_server'); define('UC_APPID', '1'); define('UC_IP', '127.0.0.1'); define('UC_PPP', 20);
config.inc
<?php define('UC_DBHOST', 'localhost'); define('UC_DBUSER', 'a064322111'); define('UC_DBPW', '321423432'); define('UC_DBNAME', 'a064322111'); define('UC_DBCHARSET', 'utf8'); define('UC_DBTABLEPRE', 'pre_ucenter_'); define('UC_COOKIEPATH', '/'); define('UC_COOKIEDOMAIN', ''); define('UC_DBCONNECT', 0); define('UC_CHARSET', 'utf-8');
永久地址:
转载随意~请带上教程地址吧^^

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1
Easy-to-use and free code editor

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
