Category Archives: MySQL

wp_wfConfig too large

While debugging some bottlenecks in one of my servers…

i’v realised that one of my db queries to Wordfence tables were causing it.

Solution was to… uninstall wordfence – to clean all their tables – anda reinstall it.

After removing it 23:30, CPU usage and Load Average was a significantly reduced.

phpmyadmin – Your password does not satisfy the current policy requirements

 mysqli_query(): (HY000/1819): Your password does not satisfy the current policy requirements

I generally use the PHPMyAdmin to generate the passwords,
what I’v done in this case, but I got the following error….

SHOW VARIABLES LIKE 'validate_password%';
Variable_nameValue
validate_password_check_user_nameOFF
validate_password_dictionary_file
validate_password_length8
validate_password_mixed_case_count1
validate_password_number_count1
validate_password_policyMEDIUM
validate_password_special_char_count1
SET GLOBAL validate_password_policy = 0;

#1366 – Incorrect integer value: ” for column ‘upd_iid’ at row 1

While I was switching a legacy site from servers… some SQLs weren’t working…

#1366 - Incorrect integer value: '' for column 'upd_iid' at row 1

This worked for me…
I’v edited my /etc/mysql/my.cnf  and comment the original “sql_mode” and added this one

sql_mode = ""

Save and restart mysql!

https://stackoverflow.com/questions/14762904/incorrect-integer-value-for-column-id-at-row-1/53154716#53154716

live MySQL queries

On your mysql console…

mysql> SHOW VARIABLES LIKE "general_log%";

+------------------+----------------------------+
| Variable_name    | Value                      |
+------------------+----------------------------+
| general_log      | OFF                        |
| general_log_file | /var/run/mysqld/mysqld.log |
+------------------+----------------------------+

mysql> SET GLOBAL general_log = 'ON';

Then!

tail -f -n200 /var/run/mysqld/mysqld.log

 

After debugging… don’t forget to turn it OFF!

mysql> SET GLOBAL general_log = 'OFF';

 

 

codeigniter + php + mysql – emojis 😉

This is how…

On mysql set your table(s)’s filed(s) to utf8mb4_general_ci.

codeigniter config/database.php
$db['default']['char_set'] = 'utf8mb4';
$db['default']['dbcollat'] = 'utf8mb4_general_ci';
Resources

https://stackoverflow.com/questions/10957238/incorrect-string-value-when-trying-to-insert-utf-8-into-mysql-via-jdbc

https://stackoverflow.com/questions/16828197/displaying-utf8-character-on-codeigniter

MySQL – compare tables and generate SQL

PHP MySql compare table structure – ONLINE!

This site can compare two MySQL database table structures and generate the necessary SQL statements to update the second table to be identical to the first.
It compares the table creation SQL statements of two MySQL databases as outputted from the mysqldump command or phpmyadmin.
The site determines what changed from one database to the other and generates schema alteration SQL statements to create, drop and alter tables that should be applied to one database to make it have the same schema of the other.

http://www.infoom.se/compare-mysql-online/