Socialabel

Friday, June 22, 2018

Perintah ProxySQL di Centos

Melihat Koneksi dan Grup yang digunakan
select * from stats_mysql_connection_pool;

Menambah Anggota Cluster
mysql> insert into mysql_servers(hostgroup_id, hostname, port) values (0,'192.168.56.102',3316);
Query OK, 1 row affected (0.00 sec)
 
mysql> insert into mysql_servers(hostgroup_id, hostname, port) values (1,'192.168.56.103',3316);
Query OK, 1 row affected (0.01 sec)
 
mysql> select * from mysql_servers;
3 rows in set (0.01 sec)
 
mysql> save mysql servers to disk;
Query OK, 0 rows affected (0.00 sec)
 
mysql> select * from disk.mysql_servers;
3 rows in set (0.00 sec)
 
mysql> load mysql servers to runtime;
Query OK, 0 rows affected (0.00 sec)

Menghapus Anggota Cluster 
mysql> delete from mysql_servers where hostgroup_id=1 and hostname='192.168.56.102';
Query OK, 1 row affected (0.00 sec)
Mengload Perubahan ProxySQL
mysql> load mysql servers to runtime;
Query OK, 0 rows affected (0.01 sec)
 
Melihat Anggota Cluster
mysql> select * from mysql_servers;

Wednesday, May 30, 2018

Time Zone Centos 7

timedatectl set-timezone Asia/Jakarta

Tuesday, May 29, 2018

Install MySQLdb Module Mysql Database di Python

You need to use one of the following commands. Which one depends on what OS and software you have and use.
  1. easy_install mysql-python (mix os)
  2. pip install mysql-python (mix os/ python 2)
  3. pip install mysqlclient (mix os/ python 3)
  4. apt-get install python-mysqldb (Linux Ubuntu, ...)
  5. cd /usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
  6. yum install MySQL-python (Linux Fedora, CentOS ...)