ERROR db sshlogs: Incorrect string value
ERROR db sshlogs: Incorrect string value: '\xA0\xA0.dc2...' for column 'file' at row 1
Overview: This article covers how to fix the "Incorrect string value" error in the sshlogs table during Ezeelogin upgrades due to special characters.
This error has been observed while upgrading Ezeelogin since the log has some type of special characters.
Step 1: Run the following command:
root@gateway:~# TBL=$(grep db_prefix /usr/local/etc/ezlogin/ez.conf | awk '{print $2}'); mysql -u root $(grep db_name /usr/local/etc/ezlogin/ez.conf | awk '{print $2}') -e "SELECT id,file FROM ${TBL}sshlogs ORDER BY id ASC LIMIT 1;"
Step 2: Run the following command and replace the ID with the ID that you get from the above command:
root@gateway:~# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_sshlogs set file='' where id=REPLACE WITH ID"
If the above steps end up following with an error then it could occur as a result of using outdated versions of MySQL. Try to manually truncate the ssh_log using below command.
Step 1: Find the database name and table prefix using the below command.
root@gateway:~# grep -i "db_name\|prefix" /usr/local/etc/ezlogin/ez.conf
Step 2: Log in to MySQL and view the ssh_logs using the database name and table prefix.
root@gateway:~# mysql -u root -p
mysql> use ezlogin_databasename;
mysql> SELECT id,file FROM prefix_sshlogs ORDER BY id ASC LIMIT 1;
Step 3: Run the following command and replace the ID with the ID that you get from the above command:
root@gateway:~# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_sshlogs set file='' where id=REPLACE WITH ID"
Related Articles:
Error log file and configuration file to troubleshoot