Author Topic: mysql issue  (Read 377 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
mysql issue
« 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:

Offline
*
Re: mysql issue
« Reply #1 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 .

Offline
*****
Re: mysql issue
« Reply #2 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
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services