Unable to restart after modifying MySQL port

Source: Internet
Author: User

Modify the MySQL port to 13306

Vim/etc/my.cnf

[Mysqld]
port=13306
Lower_case_table_names=1

Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
# Disabling Symbolic-links is recommended to prevent assorted security risks
Symbolic-links=0

[Mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid

/etc/init.d/mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]

Log error

180402 13:07:25 mysqld_safe mysqld from PID File/var/run/mysqld/mysqld.pid ended
180402 13:13:19 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql
180402 13:13:19 innodb:initializing buffer pool, size = 8.0M
180402 13:13:19 innodb:completed initialization of buffer pool
180402 13:13:19 innodb:started; Log sequence number 0 44233
180402 13:13:19 [ERROR] Can ' t start server:bind on TCP/IP port:permission denied
180402 13:13:19 [ERROR] Do you already has another MYSQLD server running on port:13306?
180402 13:13:19 [ERROR] Aborting

180402 13:13:19 innodb:starting shutdown ...
180402 13:13:24 Innodb:shutdown completed; Log sequence number 0 44233
180402 13:13:24 [Note]/usr/libexec/mysqld:shutdown complete

1. Workaround

Vim/etc/sysconfig/iptables

-A input-m state--state new-m tcp-p TCP--dport 13306-j ACCEPT

The first method is to open the external network port, the second method is used for local boot;

Do not write firewall policy, cannot Access database remotely

2. Turn off SELinux issues

Method One: Do not need to restart Linux:
[Email protected] ~]# Setenforce 0

Method Two: Need to restart Linux:
Vi/etc/selinux/config

Selinux=disabled

Unable to restart after modifying MySQL port

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.