可能是权限问题: 设置密码:grant all on dbname.* to username@hostname identified by 'your password here' 确保 mysql应用或服务已启动, 字符命令正确:mysql -u521 -p直接回车,不加;号等。
你就以默认方式登录罢了!刚开始启动数据库 mysqld然后便可以登录了 mysql -u root 库名
你用mysqlcontroo center 客户端软件可以连到MYSQL的,注意你需使用host:localhost,username:root, password: 为空, 应该可以的,你用的哪个“521”并不是MYSQL的最高权限的帐户,你先用ROOT登陆吧
试试先用mysql -u root登陆,然后 use mysql; delete from user where user='521'; 然后直接用授予权限生成用户 grant all on dbname.* to 521@hostname identified by 'your password here'; flush privileges; exit; 重新用mysql -u 521 -p登录试试
设置密码:grant all on dbname.* to username@hostname identified by 'your password here'
确保
mysql应用或服务已启动,
字符命令正确:mysql -u521 -p直接回车,不加;号等。
mysqld然后便可以登录了
mysql -u root 库名
应该可以的,你用的哪个“521”并不是MYSQL的最高权限的帐户,你先用ROOT登陆吧
use mysql;
delete from user where user='521';
然后直接用授予权限生成用户
grant all on dbname.* to 521@hostname identified by 'your password here';
flush privileges;
exit;
重新用mysql -u 521 -p登录试试