For many years I used xampp (for Linux: Lampp), because of its simplicity, unlike the “native” Linux apache/php/mysql apps, wich seemed to me very difficult to configure.
The pro of xampp is its simplicity (with few mouse clicks you can do all to install and configure your local php/mysql sever). But the con is that your xampp apps don’t are updated regularly, and there can raise conflicts with Linux “native” mysql.
Therefore I decided to learn how to configure “native” (system-rooted, so to say) apache/php/mysql apps. I chose to install mariadb and not mysql.
And in these last weeks I managed to configure the server, with the following steps:
sudo apt install -y apache2
sudo apt install -y php
sudo apt install mariadb*
sudo mysql -u root -p (and within >mysql shell
GRANT ALL PRIVILEGES ON . TO 'root'@'localhost' WITH GRANT OPTION;
SHOW GRANTS FOR 'root'@localhost; //to check if it is all right
sudo systemctl enable mariadb.service