Posts

Showing posts from November, 2019

cara membuat swap file di linux

Untuk komputer/server anda, bila belum ada swap file dapat mengikuti langkah berikut. 1. Periksa apakah swap sudah aktip, bila belum lanjutkan ke langkah berikutnya. # free              total       used       free     shared    buffers     cached Mem:       2054288    1916924     137364       4456      69268    1049580 -/+ buffers/cache:     798076    1256212 Swap:            0          0          0 2.  Alokasikan 2Gb untuk swap file # fallocate -l 2G /swapfile 3. Berikan mode 600 ke swap file # chmod 600 /swapfile 4. Buatkan swapfile untuk file swapfile # mkswap /swapfile Setting up swapspace version 1, size = 2097148 KiB no label, UUID=2947f0f6-d589-4837-a642-2f82f001d2fd 5. Aktipkan Swap file # swapon /swapfile 6. Untuk memastikan swap file aktip, berikan perintah berikut: # swapon --show NAME      TYPE SIZE USED PRIO /swapfile file   2G   0B   -1 7. Bisa juga ditampilan di memory dengan perintah free # free          

Memperbaiki Database MySQL/MariaDB yang bermasalah.

Langkah memperbaiki Database MySQL/MariaDB yang bermasalah. 1. Edit file /etc/my.cnf dan tambahkan baris  innodb_force_recovery = 1 Code (Text): [mysqld] innodb_force_recovery = 1 Bila masih gagal, ganti dengan angka 2 atau 3 dan seterusnya. 2. Aktipkan MySQL/MariaDB Server Code (Text): #service mysql restart 3. Masuk ke MySQL Code (Text): #msyql Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 46560 Server version: 5.5.61-cll MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 4. Export semua database : Code (Text): mysqldump --all-databases > /backup/alldatabases.sql 5. Hentikan MySQL/MariaDB Server Cod