1、本地登录linux服务器报“1045 -Access denied for user (用户访问被拒绝)”
造成上面链接问题的原因是,用户权限不足,需要在linux服务器上执行如下2条命令即可
CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'root123';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION;
2、其他的方式,网上有提示执行如下命令
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY 'root123' WITH GRANT OPTION;
执行如上命令会报:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘IDENTIFIED BY ‘root123’ WITH GRANT OPTION’ at line 1
造成如上原因的问题,是一次性赋权失败;需要进行分步受限;
1)受限创建用户
CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'root123';
2)然后再为该用户授予特定的权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' WITH GRANT OPTION;