How can I change mysql port from 0 to 3306?

前端 未结 7 2051
轻奢々
轻奢々 2021-02-19 03:27

I find it hard to establish a link between jdbc and mysql. I think one of the reasons is the mysql port. I checked the port with the statement: \"show variables like \'port\';\"

相关标签:
7条回答
  • 2021-02-19 04:01

    I had this problem because I had forgotten that I started mysqld with the --skip-networking flag in order to reset the MySQL root password, like so:

    sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
    

    Run ps aux | grep mysql and you may see the process (or a pair of them) hanging around still. If so, kill it/them and then restart mysql.

    0 讨论(0)
提交回复
热议问题