是否有可能在docker mysql运行容器以及windows 10 mysql中使用3306端口(相同的端口)

我在tomcat 7中部署我的war文件并使用以下命令启动tomcat

docker run -it --rm -p 7008:8080 -v //d/docker_tomcat/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml:ro -v //d/docker_tomcat/webapps:/usr/local/tomcat/webapps:rw tomcat:7.0 

当tomcat启动时,它显示以下错误日志:
使用AbandonedObjectPool(org.apache.commons.dbcp.AbandonedObjectPool@9030ca2)
LogAbandoned:true
RemoveAbandoned:true
RemoveAbandonedTimeout:90
[localhost-startStop-1]错误org.hibernate.util.JDBCExceptionReporter – 无法创buildPoolableConnectionFactory

我认为上面的错误意味着数据库studentdb不可访问

这里是我的hibernate.properties文件: –

 hibernate.dialect=org.hibernate.dialect.MySQLDialect hibernate.connection.driver_class=com.mysql.jdbc.Driver hibernate.connection.username=root hibernate.connection.password=root hibernate.connection.url=jdbc:mysql://10.0.75.x<ip of docker>:3306/studentdb?autoreconnect=true&zeroDateTimeBehavior=convertToNull&jdbcCompliantTruncation=false show_sql=false hibernate.jdbc.use_streams_for_binary=false hibernate.dbcp.testOnBorrow=true hibernate.dbcp.validationQuery=SELECT 1 FROM DUAL hibernate.dbcp.testOnReturn=false hibernate.dbcp.maxWait=2000 hibernate.dbcp.testWhileIdle=true hibernate.dbcp.minEvictableIdleTimeMillis=1800000 hibernate.dbcp.timeBetweenEvictionRunsMillis=300000 hibernate.dbcp.numTestsPerEvictionRun=5 hibernate.dbcp.removeAbandoned=true hibernate.dbcp.removeAbandonedTimeout=90 hibernate.dbcp.logAbandoned=true 

我认为hibernate.properties文件的hibernate.connection.url属性可能有错误。

也怀疑是因为我的Windows 10使用端口3306为MySQL以及docker也使用端口3306为MySQL。 如果是它的问题,那么我怎么能改变端口在运行在docker与一些不同的端口的MySQL容器

使用以下命令将您的本地端口转发到docker集装箱端口

docker run -p <LOCAL-PORT>:3306 <mysql-image-name>