How can I change mysql port from 0 to 3306?

前端 未结 7 2060
轻奢々
轻奢々 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:56

    allow remote connection fixed, didn't change " GLOBAL VARIABLES LIKE 'PORT';" edit my.cnf /etc/my.cnf

    [mysqld]
    user            = mysql
    basedir         = /usr
    pid-file        = /var/run/mysqld/mysqld.pid
    socket          = /var/run/mysqld/mysqld.sock
    port            = 3306
    datadir         = /var/lib/mysql
    tmpdir          = /tmp
    language        = /usr/share/mysql/English
    bind-address    = 65.55.55.2
    # your mysql server ip address should place in bind-address
    # skip-networking
    

    restart the mysql service

提交回复
热议问题