Address
9 G Tower Grand Rama 9 Building, Room VO10022, 31st Floor
Rama 9 Road, Huai Khwang Subdistrict,
Huai Khwang District Bangkok 10310
Work Hours
Monday to Friday: 9AM - 6PM
1 min read
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
sudo rm -rf /etc/mysql /var/lib/mysql /var/log/mysql
sudo apt autoremove
sudo apt autoclean
sudo reboot
sudo apt install mysql-server-core-8.0 mysql-server-8.0
On some systems, like Ubuntu, MySQL uses the Unix auth_socket plugin by default.
Basically it means that: db_users using it, will be “authenticated” by the system user credentials. You can see if your root
user is set up like this by doing the following:
sudo mysql -u root # I had to use "sudo" since it was a new installation
mysql> USE mysql;
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------------------+
| User | plugin |
+------------------+-----------------------+
| root | auth_socket |
| mysql.sys | mysql_native_password |
| debian-sys-maint | mysql_native_password |
+------------------+-----------------------+
As you can see in the query, the root
user is using the auth_socket
plugin.
There are two ways to solve this:
mysql_native_password
plugindb_user
with you system_user
(recommended)sudo mysql -u root # I had to use "sudo" since it was a new installation
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
sudo service mysql restart
Powered by BetterDocs