代码如下:
<?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()函数,默认参数是以进程用户名,空密码连接,可是我在代码中加入了参数为什么还以默认参数执行?请高手指点

解决方案 »

  1.   

    Access denied for user 'SYSTEM'@'localhost'
    你用的用户不是ROOT.看清楚了。
      

  2.   

    用户是root请问应该怎样修改?
      

  3.   

    用mysql.exe连接可以吗?
    mysql -u root -p
      

  4.   

    看一下你的MY.INI或者MY.CNF里是不是已经设置了默认连接
      

  5.   

    用mysql -u root -p  可以连接MY.INI文件如下,请高手看下设置是否有问题:
    [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