How can I change mysql port from 0 to 3306?

前端 未结 7 2057
轻奢々
轻奢々 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 03:59

    You need to edit your mysql config file, my.cnf in /etc/my.cnf and change the port to 3306. Then restart mysql.

    Source: http://www.cyberciti.biz/faq/change-default-mysql-port-under-linuxunix/

    Edit:

    This website might help you a bit more for your specific platform: https://wiki.archlinux.org/index.php/MySQL#Configuration

    It has a portion talking about copying over your my.cnf file:

    Copy your choice of config file:

    # cp /usr/local/mysql/support-files/my-medium.cnf /usr/local/mysql/data/my.cnf

提交回复
热议问题