Solution of error “ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES”

I once ran a SQL query: And I found the following error: ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES Since the REPLICATION SLAVE privileges are global and can not be assigned to a particular database, they must be specified globally in the query, so the SQL query should look like this: […]

Executing a SQL query from a script in Linux

It was necessary recently to write a script that executes a sql query into the MySQL database. Example content: In order for the script to run automatically, open the crontab file in any text editor (in the nano editor CTRL+X for the output and y/n for saving or canceling the changes): Add the following line […]