1.Mysql Error:1018:can't read dir of ‘./dbname’
原因:
mysql用户不是dbname目录的owner
此时可以#ls -l 或 #ll 查看该目录的详细信息,就可发现库目录的属主不是mysql
解决方法:
#chown -R mysql:mysql mysql数据库存储目录/dbname
2.ERROR 1130: Host '192.168.1.50' is not allowed to connect to this MySQL server
原因:
MySQL使用“用户名@地址”方式判断用户的登录
解决方法:
在MySQL安装机器,登入mysql后,使用下面的任一方法
直接更改MySQL权限控制数据表
更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
use mysql;
update user set host = '%' where user = 'root';
授权
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
3.duplicate key
简单解决用replace into 代替 insert into
重要的是找到重复的原因