Skip to content


mysql连接本地非默认端口

今天需DUMP个本地MYSQL db时遇到的奇怪问题,用mysql_multi起的多实例,连接到localhost时-P端口无效.
mysqldump和mysql一样无效

常规连接mysql数据库命令为,没问题
mysql -hlocalhost -uroot -p

连接本地其它端口老是跑到3306去,但是用其它机器加IP是可以连接.
mysql -hlocalhost -P3308 -uroot -p

暂时用socket连接解决问题,只导出结构.
mysqldump -s/tmp/mysql_3308.sock -uroot -p -d mydb > mydb createdb.sql

Posted in Mysql.

Tagged with .


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.