Go Back   Linux CentOS, Control Panel, Hot girl, TOP 10 GOOGLE, Server - System - Manager - CentOS, Operation System, SEO, VBB, HACKING and SECURITY - Rao vặt, tuyển dụng, Thiet ke website > CentOS Việt Nam - Viet Nam Linux CentOS Community > Cài đặt CentOS và ứng dụng > MySQL trên CentOS

Hack gunz.2it.in mới update ngày 2/3/2010 (test by Admin)
Hack map trong Dota - WarCraft 3 (da test ngay 27/01/2010)
Hack gg để chơi map dota cho war 1.23 va 1.24 - vẫn xài tốt
Hướng dẫn Hack gold member tại quán net để mang về nhà
hack map dota cho war3 ver 1.24c va 1.24d, co the chuyen tien
crack windows 7 all version (using activators)
hack cf 1052, hack cf 1053, hack cf 1054 ngay 15/02/2010

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-07-2008
sieuhosting's Avatar
Moderator
 
Join Date: Jul 2008
Posts: 99
Thanks: 8
Thanked 7 Times in 6 Posts
Lightbulb Reset password của root - MySQL trên Windows - Linux

Trên Windows:
vào Start -> Run -> gơ
Code:
services.msc
Enter
T́m services MySQL và stop lại

sau đó t́m thư mục cài đặt mySQL giả sử C:\mySQL
Vào Start-> Run -> gơ
Code:
cmd
Enter.
ta vào thư mục bin
Code:
cd C:\mysql\bin
và gơ lệnh
Code:
C:\mySQL\bin\>mysqld-nt --skip-grant-tables
Giữ nguyên cửa số đó và mở thêm 1 cửa sổ command mới
vào bin và gơ lệnh
Code:
C:\mySQL\bin\>mysql -u root
khi đó sẽ login vào root mà không cần password.
Để Reset password root ta dùng lệnh
Code:
mysql>use mysql; update user set Password=PASSWORD('new_pass') WHERE User='root';FLUSH PRIVILEGES;
trong đó new_pass chính là password của bạn.

Trên Linux:
Trường hợp cài đặt bằng gói RPM:
1. Gain root access to your Linux system - Lên quyền root:
Code:
[user@localhost ~]$ su -
Password:
[root@localhost user]#
2. First you have to stop the daemon - Dừng ngay mysql lại

Code:
[root@localhost root]# /etc/init.d/mysqld stop
[root@localhost root]#
3. Nếu sử dụng RedHat, CentOS... th́ dùng
Code:
[root@localhost root]# mysqld_safe --skip-grant-tables --skip-networking
[root@localhost root]#
Nếu dùng OS khác (ubutun...) th́ thay thế services mysqld_safe thành safe_mysqld
You will now start MySQL in safe mode without reading the grant tables with all MySQL database passwords and also you will disable networking. The "safe_mysqld" command will do this trick for you. Chạy mysql trong safe_mode mà không cần đăng nhập và bạn cũng sẽ disable networking cho mysql luôn - đề pḥng thằng nào nhân cơ hội này nó vào ).

4. The "mysqladmin" command will now reset[rewrite] the root password. In this case we are setting it to "newpassword". sử dụng mysqladmin sẽ reset lại password. Trong trường hợp này ta phải sử dụng lệnh sau để set 1 pass mới.

Code:
[root@localhost root]# mysqladmin -u root flush-privileges password "newpassword"
[root@localhost root]#
5. Stop the running daemon - Dừng chạy cái mysql_safe:

Code:
kill `cat /var/run/mysqld/mysqld.pid`
6. And finally restart it - và cuối cùng khởi động lại:

Code:
[root@localhost root]# /etc/init.d/mysqld start
[root@localhost root]#
7. You can use now your new root password - Bây giờ th́ xài pass mới xem:
Code:
[root@localhost root]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.0.20-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
XOng.

Trường hợp cài = source:
T́m thư mục cài đặt Mysql và t́m thư mục libexec bên trong nó. Bạn chạy lệnh :
Code:
[root@localhosthost libexec]./mysqld stop
[root@localhosthost libexec]./mysqld --skip-grant-tables --user=root
sau đó có thể tiến hành đăng nhập không cần password và reset password như trên windows
http://hackingart.com/mysql_tren_cen...l_command.html

Last edited by Lovelinux; 04-08-2008 at 07:20 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to sieuhosting For This Useful Post:
thixagocong (09-01-2009)
  #2 (permalink)  
Old 10-07-2008
Lovelinux's Avatar
Super Moderator
 
Join Date: Jun 2008
Posts: 251
Thanks: 24
Thanked 50 Times in 28 Posts
Default Tham khảo 1 cách tương tự: reset pass trên Linux

Đôi khi các bạn lại quên mật khẩu đăng nhập vào dịch vụ MySQL để quản trị và cấu h́nh database. Các bạn có thể reset lại mật khẩu root với các bước sau. Các hướng dẫn sau dành cho hệ điều hành CentOS.

1. Đăng nhập vào server với quyển root

2. Ngừng dịch vụ MySQL
Code:

HTML Code:
[root@get2you.com /]# /etc/init.d/mysqld stop
3. Khởi động dịch vụ MySQL với chế độ không xác thực, chạy lệnh sau ở chế dộ background.
Code:

HTML Code:
[root@get2you.com /]# /usr/bin/mysqld_safe --skip-grant-tables &
4. Kết nối vào MySQL & cập nhật lại mật khẩu root với các lệnh sau:

Code:

HTML Code:
 [root@get2you.com /]#/usr/bin/mysql -u root

mysql> USE mysql;

mysql> UPDATE user SET PASSWORD = Password('your_password') WHERE User='root';

mysql> FLUSH PRIVILEGES;

mysql> exit;
5. Tắt dịch vụ MySQL

Code:

HTML Code:
[root@get2you.com /]#/usr/bin/killall mysqld
6. Khởi động lại dịch vụ MySQL

Code:

HTML Code:
 [root@get2you.com /]#/etc/init.d/mysqld restart
7. Kiểm tra lại kết nối đến MySQL Server

Code:

HTML Code:
 [root@get2you.com /]#/usr/bin/mysql -u root -p
Reset password root MySQL trên Linux - Hack2Learn

Last edited by Lovelinux; 04-08-2008 at 07:16 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to Lovelinux For This Useful Post:
hack2learn (19-08-2008)
  #3 (permalink)  
Old 15-07-2008
Lovelinux's Avatar
Super Moderator
 
Join Date: Jun 2008
Posts: 251
Thanks: 24
Thanked 50 Times in 28 Posts
Default

nguồn Reset Forgotten MySQL Root Password | HowtoForge - Linux Howtos and Tutorials
Code:
mysqld_safe --skip-grant-tables
You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password.

Code:
mysql --user=root mysql
Code:
update user set Password=PASSWORD('new-password');
flush privileges;
exit;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hướng dẫn cài đặt Linux CentOS trên máy ảo VMWave Lovelinux Cài đặt CentOS và ứng dụng 1 24-07-2008 04:57 AM
Đổi password, set password trong mySQL command sieuhosting MySQL trên CentOS 0 10-07-2008 07:20 PM
Công nghệ clustering trên Linux Lovelinux Giới thiệu CentOS và tài liệu 1 10-07-2008 03:03 AM
Cài đặt các ứng dụng từ mă nguồn trên Linux get2you Cài đặt CentOS và ứng dụng 0 04-07-2008 05:37 PM


All times are GMT +8. The time now is 08:10 AM.


© Diễn đàn HackingArt (HA) được xây dựng và phát triển bởi các thành viên.
+ Diễn đàn HackingArt là nơi trao đổi của các webmaster chuyên nghiệp.