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

解决UCenter info: Can not connect to MySQL server的方法

WBOY
Release: 2016-05-25 16:47:30
Original
1649 people have browsed it

今天把网站换了台服务器结果发现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_';
Copy after login

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);
Copy after login

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;);
Copy after login


永久地址:

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

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template