MySQL server cannot apply modifications in my.cnf file
P粉092778585
P粉092778585 2023-09-06 14:28:28
0
1
466

I have installed mysql server and mysql client using bundles on Centos 7. The port of mysql server is shown as 0. I want to assign it a specific port. To this end, I have modified /etc/my.cnf as follows:

port=4545

After modification, I restarted the service. But it skips network settings when starting up and the status is ON. I also tried changing skip-networking to OFF without success.

After the change, I also tried mysql_secure_installation but got the following error:

fail! Error: The MySQL server is running with the --skip-grant-tables option and therefore cannot execute this statement

How can I solve this problem? Thank you for your answer

P粉092778585
P粉092778585

reply all(1)
P粉957723124

I have solved my problem by:

systemctl stop mysqld
systemctl daemon-reload
systemctl set-environment MYSQLD_OPTS="--skip-networking=OFF"

After this, I restarted the service.

systemctl start mysqld
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!