Chinaunix首页 | 论坛 | 博客
  • 博客访问: 166857
  • 博文数量: 48
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 640
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-22 15:54
文章分类
文章存档

2011年(2)

2010年(13)

2009年(30)

2008年(3)

我的朋友

分类: Mysql/postgreSQL

2010-10-20 09:28:11

大致意思就是给mysql中的root用户添加密码 (密码我就用******表示)

[ooo@localhost ~]$ mysqladmin -u root -p ******
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

[ooo@localhost ~]$ sudo /etc/init.d/mysqld stop
停止 MySQL: [确定]


[ooo@localhost ~]$ sudo mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 17641

[ooo@localhost ~]$ nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
mysql -u root mysql (注意这里要自己输入 没提示的)
mysql> UPDATE user SET Password=PASSWORD('******') where USER='root';
Query OK, 3 rows affected (0.02 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye


[ooo@localhost ~]$ sudo /etc/init.d/mysqld restart
STOPPING server from pid file /var/run/mysqld/mysqld.pid
081205 12:11:33 mysqld ended

停止 MySQL: [确定]
启动 MySQL: [确定]
[1]+ Done sudo mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[ooo@localhost ~]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
阅读(703) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-20 16:36:52

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com

chinaunix网友2010-10-20 16:36:37

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com