RSS

Auto Restart Mysql Bash

Buat script /usr/local/bin/check-mysql.sh:

#!/bin/bash

# Config
MYSQL_USER="root"
MYSQL_PASS="your_password"
MYSQL_HOST="localhost"
MYSQL_PORT="3306"
LOG_FILE="/var/log/mysql-check.log"

# Function untuk log
log_message() {
    echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> $LOG_FILE
}

# Cek jika MySQL service running
check_mysql_service() {
    if systemctl is-active --quiet mysql; then
        return 0
    else
        log_message "MySQL service is not running"
        return 1
    fi
}

# Cek koneksi MySQL
check_mysql_connection() {
    if mysqladmin -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER -p$MYSQL_PASS ping > /dev/null 2>&1; then
        return 0
    else
        return 1
    fi
}

# Main script
log_message "Starting MySQL health check"

if check_mysql_service; then
    if check_mysql_connection; then
        log_message "MySQL is running and responsive ✓"
        exit 0
    else
        log_message "MySQL service running but not responding - Restarting..."
        systemctl restart mysql
        sleep 5
        
        # Cek lagi setelah restart
        if check_mysql_connection; then
            log_message "MySQL successfully restarted ✓"
        else
            log_message "Failed to restart MySQL ❌"
        fi
    fi
else
    log_message "MySQL service not running - Starting..."
    systemctl start mysql
    sleep 5
    
    if check_mysql_service && check_mysql_connection; then
        log_message "MySQL successfully started ✓"
    else
        log_message "Failed to start MySQL ❌"
    fi
fi


#Permission exe
sudo chmod +x /usr/local/bin/check-mysql.sh

#crontab
# Check MySQL setiap 5 menit
*/5 * * * * /usr/local/bin/check-mysql.sh

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Install SDK DigitalPersona 1.6 Windows 11

Download "AdvancedRun" from Nirsoft and start CMD.exe as TrustedInstaller (Instructions are here).

In the TrustedInstaller Command Prompt, run:

  • icacls c:\windows\system32\en-us /grant administrators:F

  • icacls c:\windows\system32\en-us /grant "NT AUTHORITY\SYSTEM":F

(For each command, you should see the message "Successfully processed 1 files; Failed processing 0 files" in the output.)

Pls upload the screenshot.

See if you can install the DigitalPersona driver/software now; launch the installer via admin Command Prompt or Task Manager → Run New Task → "Create this task with administrative privileges".

If nothing helps, provide the download link for that software. I'll see if I can repro the issue.

Reff: https://answers.microsoft.com/en-us/windows/forum/windows_11-hardware/win-11-driver-install-issues/569d184e-57bc-4269-9ab7-daa91a76c46f?messageId=4fb1f526-a732-46ab-8ca9-1ec477e68fcd

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

simple my.cnf

[client]
port            = 3636
socket          = /tmp/mysql.sock

[mysqld]
port            = 3636
socket          = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

bind-address = xxx.xxx.xxx.xxx
log_bin_trust_function_creators = 1
expire_logs_days = 3

#event_scheduler = ON

log-bin=mysql-bin
binlog_format=mixed
server-id       = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS