请教高手,在线等!

arbing1980 2004-03-21 08:55:44
我刚装完mysql ,请问如何设置root 密码。我用mysql -u root -p new_password
命令输入密码总是错误。
...全文
22 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
batt 2004-03-22
  • 打赏
  • 举报
回复
然后exit
使用mysqladmin -u root -p flush-privileges
batt 2004-03-22
  • 打赏
  • 举报
回复
首先使用mysql -u root -p mysql进入mysql
再使用楼上的方法
疯狂的技术宅 2004-03-22
  • 打赏
  • 举报
回复
装完的mysql默认密码是空的。

1.SET PASSWORD FOR root@"%" = PASSWORD('your_password');
SET PASSWORD FOR root@"localhost" = PASSWORD('your_password');
2.update user set password=PASSWORD('your_password') where user='root' and host ='%';
update user set password=PASSWORD('your_password') where user='root' and host ='localhost';

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧