MySQL, Percona, MariaDB Error: Out of sort memory, consider increasing server sort buffer size!

There is a bug in MySQL 8.0.18, and above https://bugs.mysql.com/bug.php?id=103225 it was patched in 8.0.28 https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-28.html It looks as though Percona released version 8.0.28, which includes all features and bug fixes in MySQL. However, if you only do security updates, it’s possible you might have an older version of Percona based on your server’s deployment … Read more

Setting up MySQL Statistics in Netdata

MySQL Metrics in Netdata

You might noticed MySQL statistics aren’t being show in Netdata. Here’s what I ran into. Error: “MySQLdb or PyMySQL module is needed to use mysql.chart.py plugin” The required python libraries for MySQL are missing, so you simply need to install them. For Ubuntu/Debian the following command should correct it. Setting up Netdata MySQL User You … Read more

Creating Users and Databases in MySQL 8 and Percona 8

If you’ve started using MySQL 8, you’ll notice your usually commands for creating a user no longer function. That’s because it’s changed in MySQL 8, you need to now create a user, then grant privileges. Let’s create a user The critical part here is the “mysql_native_password” if you don’t have this portion, you’ll get errors … Read more

Searching WordPress MySQL Dump Files

From time to time, you’ll need to look at data within MySQL dump files, specifically I do it mostly with WordPress. There isn’t an easy way to search the dump unless you use grep. Here are some useful grep commands. Pull out a table. [enlighter linenumbers=”true”] grep ‘INSERT INTO `wp_bspr_users`’ dump.sql > /tmp/users.sql [/enlighter] Format … Read more

Configuring MySQL for Low Memory VPS

I’ve found the following configuration helps when you’re trying to squeeze out as much memory from a VPS as possible.   [mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock skip-locking key_buffer = 16K max_allowed_packet = 1M table_cache = 4 sort_buffer_size = 64K read_buffer_size = 256K read_rnd_buffer_size = 256K net_buffer_length = 2K thread_stack = 64K # For … Read more