RASPBERRY PI : Seeting server mysql agar bisa diakses dari LAN

14 Oct

=================================================================================
RASPBERRY PI : Seeting server mysql agar bisa diakses dari LAN
=================================================================================
sisi server mysql
===========================
pi@raspberrypi ~ $ mysql -u root -p
Enter password: xxxxxxxx
mysql> CREATE DATABASE akses_masuk;
mysql> USE akses_masuk;
mysql> CREATE USER ‘root’@’172.20.35.11’ IDENTIFIED BY ‘xxxxxxxx’;
mysql> CREATE USER ‘root’@’172.20.35.12’ IDENTIFIED BY ‘xxxxxxxx’;
mysql> CREATE USER ‘root’@’172.20.35.13’ IDENTIFIED BY ‘xxxxxxxx’;
mysql> CREATE USER ‘root’@’172.20.35.14’ IDENTIFIED BY ‘xxxxxxxx’;
mysql> CREATE USER ‘root’@’172.20.35.15’ IDENTIFIED BY ‘xxxxxxxx’;
mysql> CREATE USER ‘root’@’172.20.33.42’ IDENTIFIED BY ‘xxxxxxxx’;

mysql> GRANT ALL PRIVILEGES ON akses_masuk.* TO ‘root’@’172.20.35.11’;
mysql> GRANT ALL PRIVILEGES ON akses_masuk.* TO ‘root’@’172.20.35.12’;
mysql> GRANT ALL PRIVILEGES ON akses_masuk.* TO ‘root’@’172.20.35.13’;
mysql> GRANT ALL PRIVILEGES ON akses_masuk.* TO ‘root’@’172.20.35.14’;
mysql> GRANT ALL PRIVILEGES ON akses_masuk.* TO ‘root’@’172.20.35.15’;
mysql> GRANT ALL PRIVILEGES ON akses_masuk.* TO ‘root’@’172.20.33.42’;
mysql> FLUSH PRIVILEGES;
mysql> exit

pi@raspberrypi ~ $ sudo nano /etc/mysql/my.cnf
bind-address            = 172.20.35.12
pi@raspberrypi ~ $ sudo /etc/init.d/mysql restart

===========================
sisi client mysql
===========================
[root@ubsweb ~]# mysql -u root -h 172.20.35.12 -p

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

%d bloggers like this: