Docker container to connect with MySQL locally installed

Hi,

I tried ```
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘password’;


So I gave; GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';  But still error.

And my Python code is:
db = pymysql.Connect("localhost","root","root_admin223","safety_" ) 

This is how I access the mysql.