access denied for user 'root'@'localhost' mysql netbeans code example
Example 1: mysql access denied for user 'root'@'localhost'
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Example 2: access denied for user 'root'@'localhost' mariadb
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';
FLUSH PRIVILEGES;