我正在尝试通过命令行创建数据库。这就是我输入的内容:
$ mysql
mysql> CREATE DATABASE my_db;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'my_db'
在查看ERROR 1044 (42000): Access denied for 'root' With All Privileges和mysql logging in as different user的建议后,我跑了
$ mysql -u myusername -p
ENTER PASSWORD:
ERROR 1045 (28000): Access denied for user 'myusername'@'localhost' (using password: YES)
有什么问题?
答案 0 :(得分:0)
也许更具体的问题应该是:如何在MySQL上切换用户?
获得granted the necessary rights to myusername
(使用mysql root
帐户)后,您可exit and then re-enter the mysql shell
mysql --user=user_name --password=your_password db_name