查看了好多文章,没有简单得解决方式,后来发现这种方式可以简单得解决问题:
1. 问题:
mysql控制台下创建数据库出现以下信息:
mysql> create database hellow;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'hellow'
2. 解决方法:
执行以下命令进入控制台
mysql --user=root -p
输入root用户的密码即可进入mysql控制台:
创建数据库:
create database hellow;
显示所有数据库:
show databases;
如下:
C:\WINDOWS\system32>mysql --user=root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25
Server version: 5.0.37-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database hellow;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hellow |
| test |
+--------------------+
3 rows in set (0.00 sec)
3. OK, 以上方法是简单可行的;