各位大虾,小弟公司网站采用的是php+my sql数据库,原先服务器拖管在美橙互联,由于某种原因今年将服务器转到中国万网服务器拖管。在原服务器上一切都正常,转入万网后,修改了config.inc.php连接文件(内容如下),后台也添加了数据库结构,但前台提交数据的页面提交后出现:Can't connect to MySQL server on 'localhost' (10061)错误提示,而且后台查询页面无法正常显示中文,默认编码也是charset=utf-8。请问是什么原因,小弟不懂php+my sql,求各位帮助!谢谢!最好能加小弟QQ53822072,谢谢!!!!!config.inc.php连接文件
<?php/* $Id: config.sample.inc.php 9689 2006-11-10 20:05:49Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use scripts/setup.php
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.cihar.com>.
*//*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'infiniti'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! *//*
* Servers configuration
*/
$i = 0;/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'dmc-07.hichina.com';
$cfg['Servers'][$i]['connect_type'] = 'host';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'dmc070690';
$cfg['Servers'][$i]['controlpass'] = 'd7m9z3m4d7';
/* Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['booktable'] = 'pma_book';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';/*
* End of servers configuration
*//*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';?>
<?php/* $Id: config.sample.inc.php 9689 2006-11-10 20:05:49Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use scripts/setup.php
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.cihar.com>.
*//*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'infiniti'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! *//*
* Servers configuration
*/
$i = 0;/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'dmc-07.hichina.com';
$cfg['Servers'][$i]['connect_type'] = 'host';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'dmc070690';
$cfg['Servers'][$i]['controlpass'] = 'd7m9z3m4d7';
/* Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['booktable'] = 'pma_book';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';/*
* End of servers configuration
*//*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';?>
lz 帮你up
$cfg['Servers'][$i]['controluser'] = 'dmc070690';
$cfg['Servers'][$i]['controlpass'] = 'd7m9z3m4d7'; 你的数据库密码和用户名是什么就在这里面写什么!!!
$cfg['Servers'][$i]['controluser'] = 'dmc070690';
$cfg['Servers'][$i]['controlpass'] = 'd7m9z3m4d7';
檢查用戶密碼是否正確
/* User for advanced features */
$cfg['Servers'][$i]['user'] = 'dmc070690';
$cfg['Servers'][$i]['password'] = 'd7m9z3m4d7';
你还有注意这里的两个品配置是否真确!!!
第一步
删除c:\windowns下面的my.ini第二步
打开c:\mysql\bin\winmysqladmin.exe 输入用户名 和密码第三步 在dos下 输入 mysqld-nt -remove 删除服务
在接着输入 mysqld-nt -install第四步 输入mysql 启动成功。