Access denied for user 'root'@'localhost' (using password
来源:互联网 发布:凤阳安广网络 编辑:程序博客网 时间:2024/05/09 09:57
xshell 刚安装好mysql,登录mysql 报错: Access denied for user 'root'@'localhost' (using password
解决办法:
关闭mysql:
# service mysqld stop
# mysqld_safe --skip-grant-tables
启动mysql:
# service mysqld start
//连接上mysql后可以对mysql密码进行修改
mysql -u root
mysql> use mysql
mysql> UPDATE user SET Password=PASSWORD('xxx') WHERE user='root';
mysql> flush privileges;
mysql>\q
很多情况下我们需要远程连接mysql数据库,那么就可以参考下面的权限设置
登录mysql:
1、xampp中的命令工具在/opt/lampp/bin/目录中,所以可以这样运行mysql命令
/opt/lampp/bin/mysql -uroot -p
2、也可以进入/opt/lampp/bin/目录执行mysql命令
cd /opt/lampp/bin/
./mysql -uroot -p
1,设置访问单个数据库权限
mysql>grant all privileges on test.* to 'root'@'%';
说明:设置用户名为root,密码为空,可访问数据库test
2,设置访问全部数据库权限
mysql>grant all privileges on *.* to 'root'@'%';
说明:设置用户名为root,密码为空,可访问所有数据库*
3,设置指定用户名访问权限
mysql>grant all privileges on *.* to 'tt'@'%';
说明:设置指定用户名为tt,密码为空,可访问所有数据库*
4,设置密码访问权限
mysql>grant all privileges on *.* to 'tt'@'%' IDENTIFIED BY '123';
说明:设置指定用户名为tt,密码为123,可访问所有数据库*
5,设置指定可访问主机权限
mysql>grant all privileges on *.* to 'tt'@'10.2.1.11';
说明:设置指定用户名为tt,可访问所有数据库*,只有10.2.1.11这台机器有权限访问
(下列方法保存,未尝试,转载来源:http://blog.csdn.net/ldl22847/article/details/7941962)
- #1045 - Access denied for user 'root'@'localhost' (using password: YES)
- #1045 - Access denied for user 'root'@'localhost' (using password: NO)
- #1045 - Access denied for user 'root'@'localhost' (using password: NO)
- 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: NO)
- Access denied for user 'root'@'localhost' (using password: NO)
- access denied for user 'root'@'localhost' using password yes
- 1045 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)
- Access denied for user 'root'@'localhost' (using password:YES) 解决方案
- mysql 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)
- #1045 -Access denied for user 'root'@'localhost' (using password: NO)
- SpringMVC常用基础知识【转】
- mktemp /tmp/setup.shXXXXXXXXXX失败
- 85ViewTreeObserver.addOnGlobalLayoutListener(listener)
- 设计模式之状态模式
- Algorithm Gossip: 超长整数计算(大数计算)
- Access denied for user 'root'@'localhost' (using password
- ecshop 支付宝自动发货接口-修改版
- shell file_operate
- 1027. Colors in Mars (20)
- Algorithm Gossip:长PI
- 如果有对应的库存存在,则提示客户购买
- php调试工具
- with open('abc.txt', 'r') as f
- 蓝桥杯 入门训练 圆的面积 JAVA