Mysql问题Access denied for user 'root'@'localhost'问题的解决
2013-11-04 19:53
405 查看
Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题的解决
这种问题需要强行重新修改密码,方法如下:
/etc/init.d/mysql stop (service mysqld stop )
/usr/bin/mysqld_safe --skip-grant-tables
另外开个SSH连接
[root@localhost ~]# mysql
mysql>use mysql
mysql>update user set password=password("123456") where user="root";
mysql>flush privileges;
mysql>exit
pkill -KILL -t pts/0 可将pts为0的**用户(之前运行mysqld_safe的用户窗口)强制踢出
正常启动 MySQL:/etc/init.d/mysql start (service mysqld start)
注意:另外还遇到需要service mysql star才能启动service mysql stop才能停止。
还有直接使用mysql不能找到命令,错误为“bash: mysql: command not found”可以直接**mysql的安装目录中的bin文件夹跟绝对路径运行命令,还有的需要加./mysql
才能执行。
以上完成后,需对所有配置库为root授权方可使用
首先:登陆mysql重新设置密码,如:mysql> SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!
其次:执行授权语句:GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'rootadmin' WITH GRANT OPTION;
每次退出登陆,重复执行剔除进程命令pkill -KILL -t pts/0 ,防止进程被占用。
摘自:/article/3797129.html
这种问题需要强行重新修改密码,方法如下:
/etc/init.d/mysql stop (service mysqld stop )
/usr/bin/mysqld_safe --skip-grant-tables
另外开个SSH连接
[root@localhost ~]# mysql
mysql>use mysql
mysql>update user set password=password("123456") where user="root";
mysql>flush privileges;
mysql>exit
pkill -KILL -t pts/0 可将pts为0的**用户(之前运行mysqld_safe的用户窗口)强制踢出
正常启动 MySQL:/etc/init.d/mysql start (service mysqld start)
注意:另外还遇到需要service mysql star才能启动service mysql stop才能停止。
还有直接使用mysql不能找到命令,错误为“bash: mysql: command not found”可以直接**mysql的安装目录中的bin文件夹跟绝对路径运行命令,还有的需要加./mysql
才能执行。
以上完成后,需对所有配置库为root授权方可使用
首先:登陆mysql重新设置密码,如:mysql> SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!
其次:执行授权语句:GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'rootadmin' WITH GRANT OPTION;
每次退出登陆,重复执行剔除进程命令pkill -KILL -t pts/0 ,防止进程被占用。
摘自:/article/3797129.html
相关文章推荐
- mysql“Access denied for user 'root'@'localhost'”问题的解决
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 登录MySQL时遇到问题Access denied for user 'root'@'localhost'解决
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题的解决
- ubuntu 系统解决mysql连接问题(ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:
- MySql 出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).问题解决方案
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)问题的解决办法
- mysql“Access denied for user 'root'@'localhost'”问题的解决
- 解决Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 常出现的Access denied for user 'root'@'localhost' (using password: YES)及其相关问题解决
- Access denied for user 'root'@'localhost' (using password: YES) 问题解决
- access denied for user 'root'@'localhost'(using password: YES)问题解决办法.
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- 解决 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 问题
- Access denied for user 'root'@'localhost'问题的解决