First of all - hello. Secondly, I just downloaded Docker and got it to run MySql on my Mac. It has never connected before and I am trying to learn how to make databases. Everything was running smoothly - I opened Docker and ran my container (it is running), but when I tried to connect with Microsoft Azure, it persistently refused to do so. Since my password was strong enough to fill the criteria, I checked the port and it is indeed 1433. So I started to use every variation I could think of in username, just to see what happens. Nothing. No connection. I read it could be the firewall, but all the instructions I found were Windows and other applications. Can anyone here point me in the right direction? It seems such a pathetic hill to die on.
CodePudding user response:
docker run --name <your-mysql-name> -e MYSQL_ROOT_PASSWORD=<your-sql-password> -p <host-port>:<container-port> -d mysql
You'll need to expose / publish the port (-p command), if not MySQL cannot be accessed by external sources.
For example:
docker run --name test-mysql -e MYSQL_ROOT_PASSWORD=somepassword -p 3306:3306 -d mysql
CodePudding user response:
The user name is "sa". I found it on a blog and tried it out. It worked.