To change a small snippet on Doctrine 2 ORM to learn how to handle parentheses in the WHERE clause of an SQL query.
To change a small snippet on Doctrine 2 ORM to learn how to handle parentheses in the WHERE clause of an SQL query.
When database queries are slow a good approach is to use EXPLAIN to get the execution plan of the queries. But the result is not always obvious. In this post I show you how I use EXPLAIN to solve a real performance issue.
[Paranoid Mode: ON] I think we all agree that the database is the most sensitive element of a site. Installing phpMyAdmin on a server is like exposing this data to everyone, well everyone who knows how to hack phpMyAdmin. Do you have to do without phpMyAdmin? No, it's far too practical, but a minimum of safety must be put in place to sleep soundly.
After the first post who shows the possibility of the JSON functions with MySQL 8 on a JSON array, let's talk about what we can achieve with a JSON object.
MySQL 8 has introduced an advanced support of JSON type and functions. The documentation is complete for the functions but I found the examples not very helpful and too much theorical. The idea here is to show, with a real, but simplified, database some things we can do with this format. In this first article, we will manipulate a JSON colums containing a simple array.
In this article I present you a config which allows to put the client MySQL / MariaDB in color to facilitate the reading of the results of your SQL queries.
The attribution of right in MySQL and MariaDB is sometimes a puzzle especially if one wishes to have a control by table for a user. It is possible to use a wildcard in the Grant command but its syntax is not very explicit.
Have you ever thought about using the .my.cnf configuration file to make it easier to connect to your MySQL or MariaDB databases? This configuration is very useful when you have to manage several databases and / or several servers. I propose you a presentation of what we can do with it in this article.
There are several ways to store dates in database, the choice is not so simple, especially if you need the timezone. In this article I explain the different solutions with their advantages and disadvantages.
No need to remember your password to connect to a linux server, SSH keys provide authentication. We can have the same thing on MySQL and MariaDB. With a plugin, the database server trusts the credentials of the linux system, you only need mysql account with the same name as the linux account and the password disappears from the connection. It is ideal on a development server with multiple users and it greatly facilitates the management of accounts, even if we forget to delete the mysql account, deletion of the linux account is enough.