mysql notes

Beberapa notes kecil dalam keseharian penggunaan mysql

Tools management db dengan satu file php saja – adminer

Membuat user
CREATE USER 'myUser'@'localhost' IDENTIFIED BY 'myPassword';

Memberikan akses satu database untuk satu user – more

grant all privileges on myDb.* to myUser@'%' identified by 'myPassword';

atau
grant all privileges on myDb.* to myUser@localhost identified by 'myPassword';

more –

Script dump database sebelum di backup – more
taruh di /usr/local/bin/mySriptBackupDb.sh

#!/bin/bash
mysqldump -u myUser --password=myPassword myDb > /var/backups/myDbBackupFile.sql
Advertisements

Powered by WordPress.com.

Up ↑