解决方案 »
- 求拼接树的SQL及生成json方法
- mysql的select效率太慢怎么优化?
- 【新手提问】为什么Linux下MySQL的data目录下没有information_schema数据库的文件
- 如何使这个表查询变快?
- FORCE INDEX 无效,没有使用索引求解!
- MYSQL,查询一个字符串含多少个分号,用什么函数,举例!5点结帖
- 如何快速找出丢失数据?
- 有关MYSQL5.0的编码问题?
- 基于浏览器的mysqlAdmin怎么用?
- 怎么从mysql中提出时间必当前早三天的数据?比如有一个datetime型的time字段。
- postgresql 存储过程中调用外部c函数
- 导出千万条数据,对数据库的影响?
运行结果:
mysql> grant all privileges on *.* to abcd@'%' identified by '123456';
Query OK, 0 rows affected (0.08 sec)执行后,还是连不上,继续追问
ERROR 1141 (42000): There is no such grant defined for user 'abcd' on host 'localhost'为啥米?
grant all on database.table to user@'%' identified by 'password'
select user, host from mysql.user;
我又重新创建了一次,上次是用phpmyadmin直接建的,这次是用mysql命令如下:mysql> CREATE USER 'abcd'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.02 sec)mysql> grant all privileges on *.* to 'abcd'@'%';
Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql> select user,host from mysql.user;
+------+-----------+
| user | host |
+------+-----------+
| abcd | % |
| root | 127.0.0.1 |
| | localhost |
| pma | localhost |
| root | localhost |
+------+-----------+
5 rows in set (0.00 sec)连接依然报Access denied for user 'abcd'@'localhost'
我又重新修改了下密码
mysql> update user set password=password('123456') where user='abcd';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)还不行。mysql> CREATE USER 'abcd'@'%' IDENTIFIED BY '123456';
grant all privileges on *.* to 'abcd'@'%';
试试
CREATE USER 'abcd'@'localhost' IDENTIFIED BY '123456';
咦,这样可以,咋%不行。如何使任意host都能连呢
$hostname = "你的服务器名"
我重新下了个5.1.58 社区版的,一切ok!
好了,散分结贴!