Change MySQL port under SELinux

Source: Internet
Author: User

By default, MySQL changes the port after it is not passed through the SELinux

Prompt startup error, then first look at MySQL error log

But I don't know the location of the MySQL error log

First, change the SELinux mode to passive and then start MySQL (passive mode is capable of starting MySQL)

0

Then use the PS command to view the log location:

PS ax| grep MySQL or PS ax " [M]ysql "

Find the--log-error from the output

Then open the error log

Tips:

[ERROR]  Can't start server:bind on TCP/IP port:permission denied150210 19:57:52 [ERROR] Do you already has another Mysqld server running on port:3308? 

It's obviously a mistake when you bind to port 3308!

Then you need to change SELinux to open port 3308 for MySQL

Online search after said to need to use Semanage

But there's no semanage command found in CentOS.

Then see which package provides the Semanage

Yum Provides/usr/sbin/semanage

Found the Policycoreutils-python bag.

Then install the Policycoreutils-python package

Yum Install Policycoreutils-python

When the installation is complete, bind port 3308 to MySQL

3308

Then set SELinux to force mode and restart MySQL.

Setenfoce enforcingservice MySQL Restart

Change MySQL port under SELinux

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.