can't start mysql

General support questions
Post Reply
nionet
Posts: 1
Joined: 2021/10/19 07:21:49

can't start mysql

Post by nionet » 2021/10/19 07:26:41

Hi , please help me fix this issue
i was trying to extend or clean cl-root because my server was down and i tried this solution online to move mysql to home to reduce space using this commands
mkdir /home/var_mysql
mv /var/lib/mysql /home/var_mysql
chown -R mysql:mysql /home/var_mysql/mysql
ln -s /home/var_mysql/mysql /var/lib/mysql
/etc/init.d/mysql start

and then my mysql went down and cl-root got reduced and i can't get my server up and running

Code: Select all

Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0

Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/resources/admin/include/functions.php on line 0

Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0

Warning: mysqli_connect(): (HY000/2002): Connection refused in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0


Trying to start mysql server, please wait!
Try to restart Control Web Panel with command: sh /scripts/restart_cwpsrv

**Check your MySQL root password in: /usr/local/cwpsrv/htdocs/resources/admin/include/db_conn.php and /root/.my.cnf


Warning: mysqli_error() expects exactly 1 parameter, 0 given in /usr/local/cwpsrv/htdocs/admin/admin/index.php on line 0
Could not connect:

Code: Select all

Oct 19 10:04:55 185.40.6.129 systemd[1]: Failed to start MariaDB 10.4.21 database server.

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: can't start mysql

Post by Whoever » 2021/10/21 05:45:39

SELinux status?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: can't start mysql

Post by TrevorH » 2021/10/21 12:12:52

Two things: First off we do not support CWP in any way. At all. See viewtopic.php?f=12&t=66365

Second, you have moved the mysql data directory to a non-standard location and you've not told selinux that you did it so it is denying all access to it. You need to add an equivalence rule using semanage fcontext (see man semanage-fcontext) and then restorecon the directory recursively.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply