Linux sql

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ $ sudo -i # sudo apt-get remove --purge mysql\* # cp -R /var/lib/mysql /home/user/backup # sudo rm -rf /var/lib/mysql/ # sudo rm -rf /etc/mysql # sudo apt-get autoremove # sudo apt-get autoclean # sudo apt-get install mysql-server php5-mysql Login at root from the CLI: sudo mysql -u root -p Then ALTER USER 'root'@'localhost' IDENTIFIED BY '<New-Password-Here>'; To Really Get Things Working From phpmyadmin.net Due to changes in the MySQL authentication method, PHP versions prior to 7.4 are unable to authenticate to a MySQL 8.0 blah blah blah blah .There is a workaround, that is to set your user account to use the current-style password hash method, mysql_native_password. This unfortunate lack of coordination has caused the incompatibility to affect all PHP applications, not just phpMyAdmin. So UPDATE user SET plugin="mysql_native_password" WHERE user='root'; To Really Really Get Things Working… Really MySQL Have changed their Security Model and root login now requires a sudo. This is ok for the CLI, but it means that PhpMyA[...x]