Hello Louis,
I have change /var/lib/mysql to /var/lib/mysql-bak,when I run systemctl status
mariadb and journalctl -xe, it show as below:
[root@localhost pf]# systemctl start mariadb
Job for mariadb.service failed because the control process exited with error
code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
[root@localhost pf]# systemctl status mariadb
?? mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor
preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
????migrated-from-my.cnf-settings.conf
Active: failed (Result: exit-code) since Thu 2017-07-27 08:52:58 CST; 3s ago
Process: 20457 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
$_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Process: 20445 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] &&
VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl
set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited,
status=0/SUCCESS)
Process: 20443 ExecStartPre=/bin/sh -c systemctl unset-environment
_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 20457 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Jul 27 08:52:58 localhost.localdomain systemd[1]: Starting MariaDB database
server...
Jul 27 08:52:58 localhost.localdomain mysqld[20457]: 2017-07-27 8:52:58
139925882870016 [Note] /usr/sbin/mysqld (mysqld 10.1.21-MariaDB) starting as
process 20457 ...
Jul 27 08:52:58 localhost.localdomain mysqld[20457]: 2017-07-27 8:52:58
139925882870016 [Warning] Can't create test file
/var/lib/mysql/localhost.lower-test
Jul 27 08:52:58 localhost.localdomain mysqld[20457]: [97B blob data]
Jul 27 08:52:58 localhost.localdomain mysqld[20457]: 2017-07-27 8:52:58
139925882870016 [ERROR] Aborting
Jul 27 08:52:58 localhost.localdomain systemd[1]: mariadb.service: main process
exited, code=exited, status=1/FAILURE
Jul 27 08:52:58 localhost.localdomain systemd[1]: Failed to start MariaDB
database server.
Jul 27 08:52:58 localhost.localdomain systemd[1]: Unit mariadb.service entered
failed state.
Jul 27 08:52:58 localhost.localdomain systemd[1]: mariadb.service failed.
[root@localhost pf]# journalctl -xe
Jul 27 08:52:58 localhost.localdomain systemd[1]: mariadb.service failed.
Jul 27 08:52:58 localhost.localdomain polkitd[652]: Unregistered Authentication
Agent for unix-process:20437:16630520 (system bus name :1.144, object path
/org/freedesktop/Polic
Jul 27 08:52:59 localhost.localdomain packetfence[656]: FATAL -e(656): unable
to connect to database: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.so
(pf::db::db_connect)
Jul 27 08:53:00 localhost.localdomain packetfence[656]: FATAL -e(656): unable
to connect to database: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.so
(pf::db::db_connect)
Jul 27 08:53:01 localhost.localdomain packetfence[656]: FATAL -e(656): unable
to connect to database: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.so
------------------ ???????? ------------------
??????: "packetfence-users";<[email protected]>;
????????: 2017??7??26??(??????) ????10:17
??????: "packetfence-users"<[email protected]>;
????: "Louis Munro"<[email protected]>;
????: Re: [PacketFence-users] How to config database address
On Jul 24, 2017, at 23:00, ???????? via PacketFence-users
<[email protected]> wrote:
Hello,
PF's database address is /var/lib/mysql,now I need to change it to
/opt/sqldata,and I change it follow these steps:
#cp -arp /var/lib/mysql /opt/sqldata
change mysql script:
#vim /etc/init.d/mysql
commented out70 line??# datadir=/var/lib/mysql
add line??datadir=/opt/sqldata
save and exit
That script is not used by PacketFence, so it's not going to do you any good.
#vim /usr/local/pf/addons/dev-helpers/centos-chroot/my.cnf
commented out datadir:# datadir=/var/lib/mysql
add datadir:datadir=/opt/sqldata
commented socket:# socket=/var/lib/mysql/mysql.sock
add socket: socket=/opt/sqldata/mysql.sock
save and exit\
That file is not used in a production PacketFence system.
Doing that is useless.
#vim /usr/locol/pf/conf/mariadb/maraidb.conf.tt
change as below:
#socket = /var/lib/mysql/mysql.sock
socket = /opt/sqldata/mysql.sock
#innodb_data_home_dir = /var/lib/mysql
innodb_data_home_dir = /opt/sqldata
#innodb_log_group_home_dir = /var/lib/mysql
innodb_log_group_home_dir = /opt/sqldata
#chown -R mysql:mysql /opt/sqldata
#reboot
when system rebooted,pf still cannot connect database, the log show it as below:
Jul 25 11:03:21 localhost packetfence: FATAL -e(656): unable to connect to
database: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2 "No such file or directory") at -e line 1.
how can I do to fix the problem?thank you!
Rebooting is unnecessary if all you want is to restart a service.
What is systemctl reporting?
What is journalctl showing?
Regards,
--
Louis Munro
[email protected] :: www.inverse.ca
+1.514.447.4918 x125 :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence
(www.packetfence.org)------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users