Access database via Mysql Workbench

Asked

Viewed 770 times

0

I cannot access a database from Mysql Workbench. The following message appears: inserir a descrição da imagem aqui

However, through PHPMYADMIN, I can. How do I access via Mysql Workbench?

  • Are you connecting over a remote machine? If so, your user must be allowed to connect. phpmyadmin uses a localhost user for connection, if it is using the same user from a remote machine mysql will block access. You will need to run a GRANT ALL on mysql and generate permission on the user to allow access from your remote machine.

  • Yes, the bank is on another machine. How do I give permission to the user who in the case is root access, through the Workbench?

1 answer

0


To give the user permission to access you can run this querie:

GRANT ALL PRIVILEGES ON db_name.* TO'username'@'seu_ip' IDENTIFIED BY 'password'

INTERCHANGE:

db_name by the name of your database.

username for your use in the database.

password by your access password.

seu_ip the ip of the machine that will access the mysql server.

After this command run:

FLUSH PRIVILEGES;

to update user privileges.

Remarks:

Some hosting providers do not allow remote connection to mysql.

Can also:

Use the joker instead of your ip %, but this will allow connections to mysql with that user over any network interface, and for security is not advisable.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.