@ruoli
2017-09-28T08:50:56.000000Z
字数 875
阅读 1910
数据库
GRANT ALL PRIVILEGES ON DBName.* TO UserName@'%';
Mysql禁用外键
SET FOREIGN_KEY_CHECKS = 0
Mysql启用外键
SET FOREIGN_KEY_CHECKS = 1
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
则使用如下方式解决:
ln -s /var/lib/mysql /mysql .sock /tmp/mysql .sock
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
cd /usr/local/mysql/data
会发现有一个后缀为 err 文件,文件名一般为电脑名称,即可在此文件中查看Mysql错误信息
tail -f localhost.localdomain.err
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY '66231088' WITH GRANT OPTION;