我似乎无法登录到我的教程数据库开发环境:
Ayman$ mysql -u blog -p blog_development
Enter password:
ERROR 1049 (42000): Unknown database 'blog_development'
我可以在没有 blog_development 部分的情况下很好地登录数据库:
Ayman$ mysql -u blog -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1858
当我授予所有访问权限时,不确定提供了什么:
mysql> GRANT ALL PRIVILEGES ON blog_development.*
-> TO 'blog'@'localhost'
-> IDENTIFIED BY 'newpassword';
Query OK, 0 rows affected (0.01 sec)
mysql> SHOW GRANTS FOR 'blog'@'localhost'
-> ;
+----------------------------------------------------------------------------------------- --------------------+
| Grants for blog@localhost |
+----------------------------------------------------------------------------------------- --------------------+
| GRANT USAGE ON *.* TO 'blog'@'localhost' IDENTIFIED BY PASSWORD '*FE4F2D624C07AAEBB979DA5C980D0250C37D8F63' |
| GRANT ALL PRIVILEGES ON `blog`.* TO 'blog'@'localhost' |
| GRANT ALL PRIVILEGES ON `blog_development`.* TO 'blog'@'localhost' |
+----------------------------------------------------------------------------------------- --------------------+
3 rows in set (0.00 sec)
有人知道要尝试什么吗?谢谢!另外,旁注 - 我有多个 root 用户很奇怪吗?:
mysql> select User from mysql.user;
+------+
| User |
+------+
| root |
| root |
| |
| root |
| |
| blog |
| root |
+------+
7 rows in set (0.00 sec)
编辑:对于那些询问-我在 MySql 中使用 CREATE DATABASE 命令创建了数据库博客。这是我的活动数据库:
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| blog |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)