简体   繁体   中英

MySQL Server Remote Access Denied

I'm setting up a Dev server with MySQL 8.0, and am trying to connect remotely as root with Workbench from my laptop. This gets me an access denied error, so, trying to apply solutions provided elsewhere, ie GRANT ALL PRIVILEGES..., I'm still not getting there. Maybe something changed since these solutions where posted (eg [ Enable remote MySQL connection: ERROR 1045 (28000): Access denied for user ).

From the server:

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -uroot -ppassword
mysql> grant all privileges on *.* to 'root'@'%' identified by 'password';

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'identified by 'password'' at line 1

If I remove the part the message complains about:

mysql> grant all privileges on *.* to 'root'@'%';

ERROR 1410 (42000): You are not allowed to create a user with GRANT

Any suggestion?

Thanks!

R.

In the first command your password spelling is wrong it should be

mysql -uroot -password

and I think you have set up MySQL incorrectly on your server, install it again and type this

mysql_secure_installation

it wil ask for a password and a username, create one and use it.
Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM