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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: