hky

MySQL - Startup Tips

Setting password root untuk pertama kali
$mysqladmin -u root password 'password baru'

Masukin user baru
$mysql -u root -p mysql mysql>insert into user (host, user, password) values ('%','hengky', password('passwordnya'));

Buat database baru
mysql>use mysql; mysql>create database hky; mysql>grant all privileges on hky.* to hengky; myaql>flush privileges;

Ganti password dan kasi grant ke satu orang user(hengky)
$mysql -u root -p mysql mysql>update user set password=password('password_baru') where user='hengky' mysql>flush privileges; atau mysql>set password for hengky=password('password_baru');

Load file yang berisi skema database (sql syntax)
$mysql -u hengky -p namadatabase < filenya.sql

Backup database
$mysqldump -A -u root -p > backup.sql

Comments

Proudly published with Hexo