方法很多 1:如果用phpmyadmin,那么把config.inc.php文件重cfgServers[1$cfgServers[1]['stduser'] = 'root'; // MySQL standard user (only needed with advanced auth) $cfgServers[1]['stdpass'] = 'xxxxxxx';把这个改成空的就可以了 // MySQL standard password (only needed with advanced auth) 2:在linux下改,用适当的用户名登陆到mysql下,然后password以后直接回车浅妄薄见,望与斟酌
跟我说说怎么改呀??
1:如果用phpmyadmin,那么把config.inc.php文件重cfgServers[1$cfgServers[1]['stduser'] = 'root'; // MySQL standard user (only needed with advanced auth)
$cfgServers[1]['stdpass'] = 'xxxxxxx';把这个改成空的就可以了 // MySQL standard password (only needed with advanced auth)
2:在linux下改,用适当的用户名登陆到mysql下,然后password以后直接回车浅妄薄见,望与斟酌
require_once 'DB.php';
$dsn = "mysql://mysql:mysql@localhost/db1";
$db = DB::connect($dsn);
$sql = "select * from table";
$result = db->query($sql);
这是应用PEAR里的DB.php中的对象的属性和方法来写的。详情请看你写一个phpinfo();函数后运行这个程序。然后查找include_path这一项,它的值就是DB.php所在的位置,有兴趣可以去看看里面的内容!