Langsung ke konten utama

Menambahkan user baru database mysql dengan "--skip-grant-tables" (Reset Forgotten MySql root Password Under Windows)

 Reset Forgotten MySql root Password Under Windows

=========================================================================

Kasus membuat koneksi langsung ke database SAS

1. Stop service MySQL server yang akan ditambahkan usernya (SAS21). 

   This can be done from Wamp(if you use it), or start “services.msc” using Run window, and stop the service there.


2. Buka cmd


3. Masuk folder bin (sesuaikan dengan kondisi database diinstall)


    cd "C:\DBSAS21\bin"

   

4. Jalankan


mysqld.exe -u root --skip-grant-tables


   biarkan cmd tsb terbuka


5. Buka cmd lagi


6. Jalankan


mysql


USE mysql;


INSERT INTO `USER`

SELECT '%' HOST, 'akk21' USER, PASSWORD('Akk21') Password, Select_priv, Insert_priv, Update_priv, 

                Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, 

                References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, 

                Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, 

                Alter_routine_priv, Create_user_priv, Event_priv, Trigger_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, 

                max_questions, max_updates, max_connections, max_user_connections 

FROM `USER` 

WHERE USER='sas2021';

SELECT HOST, USER, Password, Select_priv FROM `USER`;

7. Jalankan service SAS21


8. Selesai. Aplikasi SAS21 sudah dapat digunakan kembali.


=========================================================================


Reset Forgotten MySql root Password Under Windows

If you forgot root password for your MySQL database server running under Microsoft Windows, there is still a way to access your database and even reset your password using the command prompt.

Follow next steps:

1. Stop your MySQL server completely. This can be done from Wamp(if you use it), or start “services.msc” using Run window, and stop the service there.

2. Open your MS-DOS command prompt using “cmd” inside the Run window. Then go to your MySQL bin folder, such as C:\MySQL\bin. Path is different if you use Wamp.

3. Execute the following command in the command prompt:

  mysqld.exe -u root --skip-grant-tables

4. Leave the current MS-DOS command prompt as it is, and open a new MS-DOS command prompt window.

5. Go to your MySQL bin folder again.

6. Enter “mysql” and press enter.

7. You should now have the MySQL command prompt working. Type “use mysql;” so that we switch to the “mysql” database.

8. Execute the following command to update the password:


UPDATE user SET Password = PASSWORD('your_new_passowrd') WHERE User = 'root';


However, you can now run almost any SQL command that you wish.

After you are finished close the first command prompt, and type “exit;” in the second command prompt.

 You can now start the MySQL service. That’s it.




Komentar

Postingan populer dari blog ini

CREATE CROSS TAB QUERY IN MYSQL

MySQL Multi-Aggregated Rows in Crosstab Queries MySQL’s crosstabs contain aggregate functions on two or more fields, presented in a tabular format. In a multi-aggregate crosstab query, two different functions can be applied to the same field or the same function can be applied to multiple fields on the same (row or column) axis. Rob Gravelle shows you how to apply two different functions to the same field in order to create grouping levels in the row axis. Today’s topic of discussion is crosstabs, which contain multiple aggregate functions in the row axis of a tabular resultset. Recall from the the  All About the Crosstab Query  article that an aggregate function is one that summarizes a group of related data in some way. Examples of aggregate functions include COUNT, SUM, AVG, MIN, and MAX. In a multi-aggregate crosstab query, two different functions can be applied to the same field or the same function can be applied to two or more fields. Today we’ll create a query...

Mengatasi "This app can’t run on your PC Windows 10"

  Salah satu pesan error yang sering muncul saat aplikasi tidak bisa dibuka di Windows 10 adalah “ This app can’t run on your PC ,   to find a version for your PC check with the software publisher “. Masalah seperti ini cukup umum dan dialami banyak orang, terutama saat menjalankan aplikasi yang bukan dari Microsoft. Penyebab utama terjadinya masalah ini adalah karena masalah kompatibilitas antara aplikasi dengan versi Windows yang dianggap tidak sesuai oleh sistem. Bisa juga karena aplikasi atau game yang akan jalankan tersebut terkena filter oleh Windows sehingga prosesnya diblokir. Windows 10 memiliki fitur untuk memblokir aplikasi tidak dikenal yang berasal dari  unverified developers , fitur ini secara default akan aktif dengan tujuan untuk mencegah masuknya aplikasi yang mengandung malware dan virus. Penyebab lainnya bisa juga karena file aplikasi yang rusak, file sistem yang korup, atau masalah yang disebabkan oleh malware dan virus. Pada kesempatan kali ini  ...

Linux Basic Command Cheat Sheet

 https://www.guru99.com/linux-commands-cheat-sheet.html Linux Command Cheat Sheet In this Linux/Unix command line cheat sheet, you will learn: Basic Linux commands File Permission commands Environment Variables command User management commands of linux Networking command Process command VI Editing Commands Basic Linux commands Command Description ls Lists all files and directories in the present working directory ls -R Lists files in sub-directories as well ls -a Lists hidden files as well ls -al Lists files and directories with detailed information like permissions,size, owner, etc. cd or cd ~ Navigate to HOME directory cd .. Move one level up cd To change to a particular directory cd / Move to the root directory cat > filename Creates a new file cat filename Displays the file content cat file1 file2 > file3 Joins two files (file1, file2) and stores the output in a new file (file3) mv file "new file path" Moves the files to the new location mv filename new_file_name Re...