Mysql: unknown variable 'datadir=/var/lib/mysql

Can anyone help me? I don’t know when this started happening, I’ve tried upgrading cyberpanel to version 2.3. I am using centos 7.

mysql: unknown variable ‘datadir=/var/lib/mysql’

SS

What acutely you want to do?

mysql dump

Hello @aldhinya

Try this nano /home/cyberpanel/.my.cnf

[mysqldump]
user=root
password=1234567
max_allowed_packet=1024M
[mysql]
user=root
password=1234567

# Add the bunch below this line


[mysqld]
datadir= /var/lib/mysql
user= mysql
pid-file= /var/lib/mysql/mysql.pid
socket= /var/lib/mysql/mysql.sock
port= 3306

then restar mysql service

sudo /etc/init.d/mysql restart

Still error
error

Sorry i move the datadir above all the other directives. See previous post