Some months ago I created a Wordpress implementation using NGINX and mariadb (on a Raspberry Pi running Raspbian Stretch).
This developed some problems (as a result of a failed attempt to install phpmyadmin). I managed to delete most of these although phpmyadmin was still a user, and I could use Wordpress.
I wanted to do a fresh start (keeping the wordpress database) which I backed up using.
sudo mysqldump -u root -p wordpress > wordpress.sql
I backed up the existing using
sudo systemctl stop mariadb sudo mv /var/lib/mysql /var/lib/.mysql
I ran the following to reset mariadb, setting root password
sudo dpkg-reconfigure mariadb-server-10.1 sudo mysql_secure_installation
I created a new empty wordpress database and restored from database backup
sudo mysql -Bse "create database wordpress" pv wordpress.sql | sudo mysql wordpress
I restarted with
sudo systemctl start mariadb
Unfortunately when I try to connect I get an error "Error establishing a database connection"
Can anyone suggest what I may have done wrong?