Need help to connect to mysql container from MySQL Workbench (Windows 10). Here are the steps I took:
1) Installed Docker for Windows 10.
2) Downloaded mysql instance via command:
docker run --name mysql_qa -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql
3) Verified that mysql container is running (checked via "docker ps"):
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c1616f7623d4 mysql "docker-entrypoint..." 18 hours ago Up 24 minutes 0.0.0.0:3306->3306/tcp mysql_qa
4) Got he IP address of mysql container via "docker inspect mysql_qa":
"IPAddress": "172.17.0.2"
5) Verify mysql container' status via "docker logs mysql_qa" and got the following:
2017-03-17T14:47:57.495536Z 0 [Note] Event Scheduler: Loaded 0 events
2017-03-17T14:47:57.495719Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disable-partition-engine-check' to skip this check.
2017-03-17T14:47:57.495732Z 0 [Note] Beginning of list of non-natively partitioned tables
2017-03-17T14:47:57.510976Z 0 [Note] End of list of non-natively partitioned tables
2017-03-17T14:47:57.511134Z 0 [Note] mysqld: ready for connections.
Version: '5.7.17' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
Installed MySQL Workbench for Windows 64bit.
Inside MySQL Workbench, I tried to connect to mysql container using IP address 172.17.0.2 and port 3306, it failed. I also tried to connect to 192.168.99.100 and port 3306. It failed too.
Any help will be greatly appreciated. Thanks ahead.
Here's my "docker version":
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 60ccb22
Built: Thu Feb 23 10:40:59 2017
OS/Arch: windows/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 07:52:04 2017
OS/Arch: linux/amd64
Experimental: true
Problem solved: using hostname as localhost / port 3306, connected successfully. Thx.
... I used 0.0.0.0:3306 connected successfully!
I have
Hostname: 192.168.99.100
Port: 3306
When I click test connection the error dialog reads
Host '192.168.99.1' is not allowed to connect to this MySQL server.
Additionally - my environment is Win7 Home with the latest Docker Toolbox.
Any suggestions?
Same problem here. Docker Toolbox, Win10.
192.168.99.100
3306
Getting same error message as @namelus
Fixed it.
I had to create a user which has origin set as '%' as such:
CREATE USER 'monty'@'%' IDENTIFIED BY 'secret';
At the MySQL Workbench connection, use this new user. Worked.
@saifulss it working for me
That was useful for me -> tutorial
i have created a docker container with an image of mysql 5.7 but i do not know how to connect from workbench to the database that is in that container...
helppp
It looks mysql interpreting the -p as an argument, I just had to move the argument:
docker run -p 3306:3306 --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest
Anything after the image name is passed as arguments to the server. Arguments for docker have to be before it
Fixed it.
I had to create a user which has origin set as '%' as such:
CREATE USER 'monty'@'%' IDENTIFIED BY 'secret';At the MySQL Workbench connection, use this new user. Worked.
@saifulss it's also working for me.thx.
Fixed it.
I had to create a user which has origin set as '%' as such:
CREATE USER 'monty'@'%' IDENTIFIED BY 'secret';At the MySQL Workbench connection, use this new user. Worked.
This allowed me to log in to Mysql via "tableplus"... but I am unable to create new tables from within that tool. I get the error message
Access denied for user 'admin'@'%' to database 'test'
Any ideas?
Fixed it.
I had to create a user which has origin set as '%' as such:
CREATE USER 'monty'@'%' IDENTIFIED BY 'secret';
At the MySQL Workbench connection, use this new user. Worked.This allowed me to log in to Mysql via "tableplus"... but I am unable to create new tables from within that tool. I get the error message
Access denied for user 'admin'@'%' to database 'test'Any ideas?
You probably have to grant the right permissions. e.g.
GRANT ALL PRIVILEGES ON
You probably have to grant the right permissions. e.g.
GRANT ALL PRIVILEGES ON.* TO 'username'@'%' IDENTIFIED BY 'password'
This syntax did not work for me. This worked instead:
GRANT ALL PRIVILEGES ON <database_name>.* TO 'username'@'%';
database_name can be * to grant access to all databases.
This SO answer worked for me https://stackoverflow.com/a/51437525/10034557
Just worth noting that if you already have running MySQL or MariaDB on port 3306 it wouldn't work, go to your windows services, and disabled it.
What worked for me was recreating the container with the -p 3306:3306 flag, it popped up the windows firewall dialog and once I clicked "allow" I was able to connect with 'localhost' thru MySQL workbench and PyCharm. Hope this helps!
My problem solved my upgrading workbench to 8.x version
Most helpful comment
Problem solved: using hostname as localhost / port 3306, connected successfully. Thx.