MySQL Cookbook

Administration Commands

Grant database privileges for a user

GRANT ALL ON example_database.* TO 'example_user'@'%' WITH GRANT OPTION;

Disable primary key requirement

SET GLOBAL sql_require_primary_key = 0;

Error debugging:

ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation

Install MySQL Client Tools

For Ubuntu/Debian

sudo apt update
sudo apt install mysql-client -y
Error debugging
E: Package 'mysql-client' has no installation candidate

Solution:

sudo apt update
sudo apt install maria-client -y

MySQL Error Fixings

TLS/SSL Error

ERROR 2026 (HY000): TLS/SSL error: self-signed certificate in certificate chain

Solution: Just reinstall your MySQL

MySQL Dump Privilege Problem

mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

Solution: Add option --no-tablespaces to mysqldump.