代码如下:
<?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()函数,默认参数是以进程用户名,空密码连接,可是我在代码中加入了参数为什么还以默认参数执行?请高手指点
解决方案 »
- 求一条SQL语句
- mysql master-master如何做监控和故障恢复
- 关于MySQLdb的一些新发现(使用python连接mysql的库)
- mysql跨端口查询
- php+mysql菜鸟的疑问:以下实现可能性多大?
- 怎么获取执行 一句 sql 运行所需要的 ms(毫秒)数?精确一到ms!
- 我想指定删除第几行记录,请问如何写?
- Mysql4.1.0的连接问题
- 利用update复制同一表中某条数据应该如何写?
- 请问在数据库软件中,Oracle,SQL Server,Sybase,MySQL有什么不同?
- 我做新闻网站时正文内容如何在数据库中设置?
- Lost connection to MySQL server during query
你用的用户不是ROOT.看清楚了。
mysql -u root -p
[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