Differences
This shows you the differences between two versions of the page.
| coreartikel:contekan.mysql [2005/10/19 01:55] – created bang | coreartikel:contekan.mysql [2025/10/25 17:09] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== MYSQL Frequently Annoying Questions ====== | ||
| + | Setting password root mysql untuk pertama kali | ||
| + | |||
| + | < | ||
| + | $mysqladmin -u root password ‘password baru’ | ||
| + | </ | ||
| + | |||
| + | Menambah user di mysql | ||
| + | |||
| + | < | ||
| + | $mysql -u root -p mysql mysql> | ||
| + | </ | ||
| + | |||
| + | Buat database baru | ||
| + | |||
| + | < | ||
| + | $mysql -u root -p mysql | ||
| + | mysql> | ||
| + | </ | ||
| + | |||
| + | Ganti password dan kasi grant ke satu orang user(hengky) | ||
| + | |||
| + | < | ||
| + | $mysql -u root -p mysql | ||
| + | mysql> | ||
| + | </ | ||
| + | |||
| + | atau | ||
| + | |||
| + | < | ||
| + | mysql> | ||
| + | </ | ||
| + | |||
| + | Load file yang berisi skema database (sql syntax) | ||
| + | |||
| + | < | ||
| + | $mysql -u hengky -p namadatabase < filenya.sql | ||
| + | </ | ||
| + | |||
| + | Backup database | ||
| + | |||
| + | < | ||
| + | $mysqldump -A -u root -p > backup.sql | ||
| + | </ | ||
| + | |||
| + | ==== Bagaimana caranya mereset password root di mysql ? ==== | ||
| + | |||
| + | |||
| + | * Matikan daemon mysql anda, kemudian start lagi dengan menambahkan argumen --skip-grant-tables (misalnya seperti ini : / | ||
| + | * Kemudian masuk ke database mysql dan update password root yang baru, misalnya begini : | ||
| + | |||
| + | < | ||
| + | $ mysql -u root mysql | ||
| + | Welcome to the MySQL monitor. Commands end with ; or \g. | ||
| + | Your MySQL connection id is 1564 to server version: 3.23.39-log | ||
| + | |||
| + | Type ' | ||
| + | |||
| + | mysql> update user set password=password(" | ||
| + | mysql> flush privileges; | ||
| + | mysql> exit | ||
| + | </ | ||
| + | |||
| + | *Restart mysql anda seperti biasanya | ||