代码如下:
<?php
$link = mysql_connect("localhost","root","root") or die('Could not connect: ' . mysql_error());
if(!$link) echo "false";
else echo "success";
mysql_close();
?> 返回如下错误:Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in E:\web\PHPCodes\mysql_test.php on line 2
Could not connect: Access denied for user 'SYSTEM'@'localhost' (using password: NO)使用mysql-front登录mysql(root/root)正常我查了很久都没有相关的解决办法。但发现mysql_connect()函数,默认参数是以进程用户名,空密码连接,可是我在代码中加入了参数为什么还以默认参数执行?请高手指点
解决方案 »
- 一道简单的小题目
- PHP碰到一个怪问题,做一个排班表的时候,循环显示时间的时候到第五个就多加了一秒!!!!怪
- 求助:关于PHP文件中,用Ajax包含一个评论文件,该评论文件如何分页?
- 怎么获取这里的checkbox值?
- 我这种情况如何处理 最好啊?新手求救!
- php 正则表达式的最后老是有/ims 这样的 这什么意思?
- 关于php跟数据库的问题
- php能否调用其他程序?如水晶报表?
- 我的QQ在给别人发信息时,总是自动加上一句广告,用瑞星也杀不出病毒,请问怎么办???
- PHP2.3之后,post类要用$HTTP_POST_VARS取得,get 类的要用$_REQUEST取得,如何配置才可以不用$_REQUEST也可取得?
- 配置PHP5+APACHE2.2,竟然打不开php页面,而是下载,这是为什么?
- 数据库乱码问题卷土重来
现在的用户不是你说的ROOT.当然密码不是你ROOT的密码了。
仔细看你的错误提示。
还有检查你的语句。
<?
$link = mysql_connect('localhost', 'root', '');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
[client]port=3306[mysql]default-character-set=latin1[mysqld]# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="E:/web/MySQL5.0/"#Path to the database root
datadir="E:/web/MySQL5.0/Data/"# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=latin1# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"max_connections=100
query_cache_size=0
table_cache=256
tmp_table_size=5M
thread_cache_size=8myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100Gmyisam_sort_buffer_size=8M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256Ksort_buffer_size=212K
innodb_additional_mem_pool_size=2Minnodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1Minnodb_buffer_pool_size=8M
innodb_log_file_size=10M
innodb_thread_concurrency=8