-
sudo mysql
-
use mysql
-
SELECT user,authentication_string,plugin,host FROM mysql.user;
-
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
-
FLUSH PRIVILEGES;
- mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'PASSWORD';
- mysql> GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION;
note that default user with host = localhost cannot be granted to access with host = %