Change and Reset MySQL root Password Mengubah dan Reset MySQL root Password
Other then the ways specified Lainnya, maka cara yang ditetapkan here di sini to reset and change the root password for mySQL database in the case that the password is forgotten or lost, the following instructions explain in details the alternative way at the last part of the guide, where no additional file needs to be created: untuk me-reset dan mengganti password root untuk mySQL database dalam kasus yang lupa password atau hilang, instruksi berikut menjelaskan secara rinci alternatif jalan di bagian terakhir buku petunjuk, di mana tidak ada file tambahan yang harus dibuat:
- Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server. Login sebagai root untuk Windows atau mirip Unix (Unix, Linux atau BSD) mesin dengan MySQL server.
- Stop the MySQL server by using either of the following command: Menghentikan MySQL server dengan menggunakan salah satu dari perintah berikut:
Linux: /etc/rc.d/init.d/mysql stop Linux: / etc / rc.d / init.d / mysql stop
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh stop FreeBSD: / usr / local / etc / rc.d / mysql-server.sh berhenti - Open the mysql server startup script (ie mysql-server.sh – the file executed to start or stop MySQL server. Buka mysql server startup script (misalnya mysql-server.sh - file dijalankan untuk memulai atau menghentikan MySQL server.
- Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter. Menambahkan-skip-grant-tabel di bagian akhir baris yang berisi perintah mysqld_safe sebagai parameter.
- Start MySQL server with the following command: Mulai MySQL server dengan perintah berikut:
Linux: /etc/rc.d/init.d/mysql start Linux: / etc / rc.d / init.d / mysql start
FreeBSD: /usr/local/etc/rc.d/mysql-server.sh start FreeBSD: / usr / local / etc / rc.d / mysql-server.sh mulai - Alternatively, start the MySQL server directly and skip the editing with the following command: Atau, memulai MySQL server langsung dan melewatkan pengeditan dengan perintah berikut:
mysqld_safe –skip-grant-tables & mysqld_safe-skip-grant-tables &
Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead. Tergantung pada lingkungan jalan, Anda mungkin perlu untuk menunjuk ke direktori yang benar adalah dimana mysqld_safe instead.
- Run the following commands to login as the mysql user and connect to mysql user/permission database: Jalankan perintah berikut untuk login sebagai mysql user dan koneksi ke mysql user / izin database:
# mysql -u root mysql # Mysql-u root mysql
- Run the update queries to change the MySQL password: Menjalankan memperbarui permintaan untuk mengubah MySQL password:
mysql> UPDATE user SET Password=PASSWORD('newrootpassword') WHERE User='root'; mysql> UPDATE user SET Password = PASSWORD ( 'newrootpassword') WHERE Pengguna = 'root';
mysql> FLUSH PRIVILEGES; mysql> Flush PRIVILEGES;Note: Replace newrootpassword with the new root password for MySQL server. Catatan: Ganti dengan yang baru newrootpassword password root untuk MySQL server. Flush Privileges is needed to making the password change effect immediately. Flush Privileges diperlukan untuk membuat efek segera mengubah password.
- Exit mysql database client by typing exit. Keluar dari mysql dengan mengetikkan database klien keluar.
- Stop MySQL server with commands listed at step 2. Berhenti MySQL server dengan perintah yang tercantum pada langkah 2.
- Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added. Buka mysql server startup script edit dalam langkah 3 kembali dan menghapus-skip-grant-tabel parameter yang telah ditambahkan.
- Start MySQL server by using command from step 5 or 6. Mulai MySQL server dengan menggunakan perintah dari langkah 5 atau 6.
For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine: Untuk pengguna Linux Redhat, gunakan petunjuk berikut ini sebagai root dari mesin Redhat Linux:
- Stop MySQL process by using command: MySQL menghentikan proses dengan menggunakan perintah:
# killall mysqld # Killall mysqld
- Start the MySQL server with following options: Memulai MySQL server dengan beberapa pilihan berikut:
# /usr/libexec/mysqld -Sg –user=root & # / Usr / libexec / mysqld-Sg-user = root &
- Start the MySQL client: Memulai MySQL klien:
# mysql # Mysql
You should see the following message: Anda akan melihat pesan berikut:
Welcome to the MySQL monitor. Selamat datang ke MySQL monitor. Commands end with ; or g. Perintah diakhiri dengan; atau g.
Your MySQL connection id is 1 to server version: 3.xx.xx Anda koneksi MySQL id adalah 1 untuk versi server: 3.xx.xxType 'help;' or 'h' for help. Jenis' membantu; 'atau' h 'for help. Type 'c' to clear the buffer. Ketik 'c' untuk menghapus penyangga.
mysql> mysql>
- Use mysql database: Menggunakan database mysql:
mysql> USE mysql mysql> USE mysql
You should see the following message: Anda akan melihat pesan berikut:
Reading table information for completion of table and column names Membaca tabel informasi untuk menyelesaikan tabel dan nama kolom
You can turn off this feature to get a quicker startup with -A Anda dapat menonaktifkan fitur ini untuk mendapatkan dengan cepat startup-ADatabase changed Database berubah
- Then, update the password for the root user with the following command: Kemudian, memperbarui password untuk root dengan perintah berikut:
UPDATE user SET password=password(”newpassword”) WHERE user=”root”; UPDATE user SET password = password ( "Newpassword") WHERE user = "root";
Replace newpassword with your desired password. Newpassword ganti dengan password yang Anda inginkan. You should see the following message: Anda akan melihat pesan berikut:
Query OK, 2 rows affected (0.03 sec) Query OK, 2 rows affected (0,03 detik)
Rows matched: 2 Changed: 2 Warnings: 0 Baris dicocokkan: 2 Changed: 2 Peringatan: 0Rows affected may be different, but the Query OK should be there. Baris yang terkena mungkin berbeda, tetapi Query OK harus ada.
- Flush the database privileges to reload it in order to make the changes effective: Flush privileges database kembali ke dalam untuk melakukan perubahan yang efektif:
mysql> flush privileges; mysql> flush privileges;
You should get the following result: Anda akan mendapatkan hasil sebagai berikut:
Query OK, 0 rows affected (0.02 sec) Query OK, 0 rows affected (0,02 detik)
- Exit the MySQL client by typing exit. Keluar dari MySQL client dengan mengetikkan keluar.
- Kill the MySQL server process by typing killall mysqld. Membunuh proses server MySQL dengan mengetikkan killall mysqld.
- Then start MySQL again: Kemudian mulai lagi MySQL:
/etc/init.d/mysqld start / etc / init.d / mysqld mulai
IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman yang diterjemahkan mesin dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Mesin terjemahan mungkin sulit dimengerti. Please refer to Silakan merujuk ke original English article artikel asli Inggris whenever possible. bila memungkinkan.
Related Articles Artikel Terkait
- Reset the Root Password of MySQL Server Reset Password Root di MySQL Server
- Apple iPhone Root Password and Mobile User Password Apple iPhone Password Root dan Mobile Pengguna Sandi
- Reset and Change Windows NT/2000 Administrator or User Password with chntpw in Linux Ubah ulang dan atau Administrator Windows NT/2000 Pengguna Sandi dengan chntpw di Linux
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 3 Instalasi Web Server di FreeBSD 6.0 with Apache 2.2, PHP MySQL 5,0 dan 5 - Bagian 3
- Change Oracle Database User Password Ubah Oracle Database User Password
- Change or Set MySQL Long Query Time Value for log-slow-queries Mengubah atau Set Long MySQL Query Waktu Nilai untuk log-lambat-query
- Check and Optimize MySQL Database Automatically with Crontab/Cron Memeriksa dan Optimalkan MySQL Database secara otomatis dengan crontab / Cron
- How to Reset WordPress Password to Recover Forgotten Secret Bagaimana Wordpress Reset Password untuk Recover Lupa Secret
- Forgot Windows Administrator Password? Lupa Password Administrator Windows? Ways to Recover and Reset Password in Vista/XP/2003/2K/NT Cara untuk Recover dan Reset Password di Vista/XP/2003/2K/NT
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4 PhpBB 2 pada Windows XP berjalan pada Apache 2, PHP 5 dan MySQL 4










































March 12th, 2009 17:35 12 Mar 2009 17:35
@trail: Worked like a charm, thanks! @ denai: Worked like a charm, thanks!
September 23rd, 2008 17:22 September 23, 2008 17:22
worked for me on ubuntu, in just one line: bekerja untuk saya pada ubuntu, hanya dalam satu baris:
sudo dpkg-reconfigure mysql-server-5.0 sudo dpkg-reconfigure mysql-server-5,0
July 3rd, 2008 05:46 3 Jul 2008 05:46
On ubuntu, command is mysqld_safe –-skip-grant-tables & Di ubuntu, perintah adalah mysqld_safe - skip-grant-tables &
Extra dash is required so mysql can parse it correctly. Sengkang tambahan diperlukan agar dapat parsing mysql dengan benar.
May 5th, 2008 16:52 5 Mei 2008 16:52
[...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [...] Judulnya), setelah Googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX seperti di sini. Wah, perlu sedikit modifikasi ni … Berikut cara2 yang saya lakukan: 1. Wah, perlu sedikit modifikasi ... ni Berikut cara2 yang saya Lakukan: 1. Kill proses MySQL [...] Membunuh proses MySQL [...]
April 23rd, 2007 08:23 23 Apr 2007 08:23
[...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] Ubah [...] dan Reset Password root MySQL »My Digital Life (tags: mysql administrasi) Tag Gelesen No: 2 / heute: 2 [...]
December 19th, 2006 14:54 19 Des 2006 14:54
[...] Re: Help me retrieve my password Try this link… Change and Reset MySQL root Password [...] Re: Bantu saya mengambil sandi saya Coba link ini ... Ubah dan Reset MySQL root Password
July 9th, 2006 12:05 9 Jul 2006 12:05
I wanna reset my ZXDSL 831 ADSL Modemn Saya ingin saya ulang ZXDSL 831 ADSL Modemn
Plz tell me the way how to reset it Plz tell me the way how to reset
I need to do that right now Saya harus melakukan itu sekarang
Best Rgds Rgds terbaik
dugger(vincitore) dugger (vincitore)
June 6th, 2006 18:18 6 Jun 2006 18:18
[...] Alternatively, on any platform, mysql client can be used to set the new password, althought it's less secure way of resetting the password (detailed instruction here): [...] [...] Atau, pada platform manapun, mysql klien dapat digunakan untuk mengatur password baru, meskipun kurang aman jalan ulang sandi (instruksi rinci di sini): [...]