Home > Database > Mysql Tutorial > body text

mysql 无法连接问题的定位和修复过程分享_MySQL

WBOY
Release: 2016-06-01 13:24:06
Original
919 people have browsed it

bitsCN.com

定位结果如下:

客户环境:
windows server 2003 r2 standard edition sp2
mysql Ver 14.12 Distrib 5.0.18, for Win32 (ia32)
apache 2.2
瑞星
webshield客户端1.08

问题已复现。可以优化,无法确定是webshield导致的。

搭建环境:
windows server 2003 r2 standard edition sp2
mysql 5.0.18 for win32
apache-2.2.21-win32-x86-no_ssl
php-5.2.17-win32-vc6-x86
瑞星23.00.50.25

搭建环境过程中遇到的几个问题:

在下载apache与php时,请注意apache与php匹配问题。

a)PHP5.3有VC6与VC9版本,应选择VC6版本。原因如下:

i. VC6版本是使用Visual Studio 6编译器编译的,如果你的PHP是用Apache来架设的,那你就选择VC6版本。
ii. VC9版本是使用Visual Studio 2008编译器编译的,如果你的PHP是用IIS来架设的,那你就选择VC9版本。

b)PHP5.3的Thread Safe和Non Thread Safe版本。Apache no_ssl版应与php Thread Safe版搭配。若与Non Thread Safe搭配,apache启动出错:“Apache is running a threaded MPM,but your PHP Modle is not compiled to be threadsafe. You need to recompile PHP.”

i. Thread Safe是线程安全,执行时会进行线程(Thread)安全检查,以防止有新要求就启动新线程的CGI执行方式而耗尽系统资源。ISAPI执行方式是以DLL动态库的形式使用,可以在被用户请求后执行,在处理完一个用户请求后不会马上消失,所以需要进行线程安全检查,这样来提高程序的执行效率,所以如果是以ISAPI来执行PHP,建议选择Thread Safe版本;
ii. Non Thread Safe是非线程安全,在执行时不进行线程(Thread)安全检查。FastCGI执行方式是以单一线程来执行操作,所以不需要进行线程的安全检查,除去线程安全检查的防护反而可以提高执行效率,所以,如果是以FastCGI来执行PHP,建议选择Non Thread Safe版本。
注意apache对网站及PHP的正确配置。特别注意配置文件中LoadModule, PHPIniDir,DocumentRoot,ServerRoot,Directory,DirectoryIndex,AddType application/x-httpd-php等项的配置
安装后 mysql 后(管理员账号密码:admin/admin),在PHP代码中使用admin连接数据库失败,cmd执行mysql

Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!