mysql> show global variables like 'port'; 是0 原因是我的my.cnf有话: skip-network 或 注释掉,然后运行netstat -an|grep 3306 就可以看到了