When connecting to MySQL/MariaDB with Doctrine you need to specify the version number of the server in the serverVersion query string parameter. In the past it was as simple as serverVersion=mariadb-10.5.10 and things just worked. Recent updates to Doctrine’s DBAL have started to throw warnings that version 4 will require…
Category: mysql
mySQL Recursive CTE
Almost 10 years ago I asked this question on Stack Overflow about how to find the deepest nodes in a recursive table using a Common Table Expression (CTE). Fast forward to today, and I need a mySQL equivalent, specifically for MariaDB. Please read the original question to get the gist,…
MySQL DUAL table
Here’s code that should work on any MySQL server regardless of databases and tables: SELECT 1 FROM DUAL Apparently they copied it from Oracle.
MySqlDump to individual files and restoring again
Make sure that your mysql user has permission to access the file system (the FILE privilege). GRANT ALL does not do this. You can check your user by doing: select user, host, file_priv from mysql.user; To enable: grant FILE on *.* to ‘root’@’localhost’;flush privileges; Also make sure that mysqld can…