Simple tutorial run MYSQL with Docker

Install docker dulu

Run gini aja:

#docker run -e MYSQL_ROOT_PASSWORD=arif -p 3306:3306 –name mysql -itd mysql

-e : Environtment
-p : port
-itd : interactive, tty, detach

Liat processnya jalan apa engga

#docker ps

Liat log dulu udah sampe mana
#docker logs -f mysql

Liat IP (ngga harus sih)
#docker inspect mysql

 

 

Masuk ke Mysqlnya
#docker exec -it mysql bash
#mysql -p

Masukin passwordnya tadi

Setting mysql privileges

*Saya reset lagi password mysqlnya

mysql> grant all on *.* to root@’%’ identified by ‘arif’;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;

Coba akses dari dari IP

 

 

 

 

Done

Thanks to Om shand

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