search
Homephp教程php手册解决UCenter info: Can not connect to MySQL server的方法

今天把网站换了台服务器结果发现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(&#39;UC_CONNECT&#39;, &#39;mysql&#39;);
define(&#39;UC_DBHOST&#39;, &#39;localhost&#39;);
define(&#39;UC_DBUSER&#39;, &#39;a064322111&#39;);
define(&#39;UC_DBPW&#39;, &#39;321423432&#39;);
define(&#39;UC_DBNAME&#39;, &#39;a064322111&#39;);
define(&#39;UC_DBCHARSET&#39;, &#39;utf8&#39;);
define(&#39;UC_DBTABLEPRE&#39;, &#39;`a064322111`.pre_ucenter_&#39;);
define(&#39;UC_DBCONNECT&#39;, 0);
define(&#39;UC_CHARSET&#39;, &#39;utf-8&#39;);
define(&#39;UC_KEY&#39;, &#39;VdMcG6D4Pdx1S1H2Acfab6o3j4t5x5xfV7vaTbg5I17dE1Y3k0ueh6EaQ3b8EaBb&#39;);
define(&#39;UC_API&#39;, &#39;http://www.phprm.com / uc_server&#39;);
define(&#39;UC_APPID&#39;, &#39;1&#39;);
define(&#39;UC_IP&#39;, &#39;127.0.0.1&#39;);
define(&#39;UC_PPP&#39;, 20);

config.inc

<?php 
define(&#39;UC_DBHOST&#39;, &#39;localhost&#39;);
define(&#39;UC_DBUSER&#39;, &#39;a064322111&#39;);
define(&#39;UC_DBPW&#39;, &#39;321423432&#39;);
define(&#39;UC_DBNAME&#39;, &#39;a064322111&#39;);
define(&#39;UC_DBCHARSET&#39;, &#39;utf8&#39;);
define(&#39;UC_DBTABLEPRE&#39;, &#39;pre_ucenter_&#39;);
define(&#39;UC_COOKIEPATH&#39;, &#39;/&#39;);
define(&#39;UC_COOKIEDOMAIN&#39;, &#39;&#39;);
define(&#39;UC_DBCONNECT&#39;, 0);
define(&#39;UC_CHARSET&#39;, &#39;utf-8&#39;);


永久地址:

转载随意~请带上教程地址吧^^

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

Video Face Swap

Video Face Swap

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

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MantisBT

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

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

Notepad++7.3.1

Easy-to-use and free code editor

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