所以,我创建了一个新用户
CREATE USER servname_shb IDENTIFIED BY 'password';
授予他所有特权:
GRANT ALL ON *.* TO servname_shb;
到目前为止没有错误.然后我尝试连接到数据库:
$dbhost = "localhost";
$dbname = "servname_shbusers";
$dbuser = "servname_shb";
$dbpass = "password";
$c = mysql_connect($dbhost,$dbuser,$dbpass) or die("Error:".mysql_error());
mysql_select_db($dbname) or die ("Error connecting to databse:".mysql_error());
并得到一个错误:
Access denied for user 'servname_shb'@'localhost' (using password: YES) in
我尝试了FLUSH PRIVILEGES,删除并重新创建用户 – 没有效果.我究竟做错了什么?