0

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, i.e. GRANT ALL PRIVILEGES..., I'm still not getting there. Maybe something changed since these solutions where posted (e.g. [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.

mrgou
  • 1,576
  • 2
  • 21
  • 45
  • you likely need to add the user 'root'@'%', which is different from 'root'@'localhost'. You can do this in multiple way, like direct `insert to mysql.users` table – Bacon Jul 13 '18 at 13:34
  • it looks like MySQL 8.0 has removed "Implicit Account Creation" which existed in MySQL 5.7 within the GRANT statement according the MySQL documentation.. You you need to create the MySQL user first with `CREATE USER`.. inserting directly into `mysql.users` like @Bacon says is not adviced – Raymond Nijland Jul 13 '18 at 13:54

1 Answers1

0

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

j.edgar
  • 13
  • 7