- Delete or comment the
bind_addressparameter from themy.inifile.
(The file name is different depend on the OS. On Linux my.ini is
actually my.cnf located in directory /etc/mysql/)
- Restart the service.
-
Create the
rootuser (yes, a new user because what exists is ‘root@localhost’ which is local access only):CREATE USER 'root'@'%' IDENTIFIED BY '123'; -
Give the privileges:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
For DBA user, add
WITH GRANT OPTIONat the end.e.g.
CREATE USER 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION;
Because it does not work CREATE with GRANT?
MySQL 8 can no longer create a user with GRANT, so there is an error in IDENTIFIED BY '123' if you try to use it with GRANT, which is the most common error.