Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: nionet on October 19, 2021, 10:24:31 AM

Title: mysql issue
Post by: nionet on October 19, 2021, 10:24:31 AM
Hi my server was down due to low space in cl-root and i tried this ssh commands to move mysql to home

Quote
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


 but it broke my server mysql system and now i'm struggling to fix it please help me
Quote
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:
Title: Re: mysql issue
Post by: nionet on October 19, 2021, 11:09:37 AM
Please help me fix it i'm having blank screen now , i can share my root detail
thank you .
Title: Re: mysql issue
Post by: Igor S. on October 21, 2021, 03:01:54 PM
You can set the datadir in /etc/my.cnf instead of strange ln -s /home/var_mysql/mysql /var/lib/mysql
Also, if you using CentOS 7 or CentOS 8 you will have to set ProtectHome=No in /usr/lib/systemd/system/mariadb.service