WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Not persistent changes have become persistent! Could you help me?  (Read 534 times)

Offline Yarpi

  • Newbie
  • *
  • Posts: 13
Hello,

I was in a sleeping state some weeks ago and I was modifing my system to build a web server, I have made some modification and now they are persistent. How is it possible?

When I load mariadb-10.4.tcz it load the file in /usr/local/etc/init.d/ called mysql and in it there is written that the home directory for mysql data is /home/tc/mysql/data and this is the change that I've made while I was sleeping and if I change it (eg. /usr/local/mysql/data) when I reboot the computer it rool back to /home/tc/mysql/data. What have I changed?

P.S. I want to change it because the mariadb server doesn't start, if I launch it as root, it says that cannot start as root, if I start it with sudo -u tc ./mysqld it says permission denied on Bind on unix socket and it asks me if I have another mysqld server running on socket /var/run/mysql.sock Another error is Can't open and lock privilege tables.

Thank you in advance.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11256
Re: Not persistent changes have become persistent! Could you help me?
« Reply #1 on: December 31, 2023, 09:21:27 AM »
Hi Yarpi
/usr/local/  is not a persistent directory so  /usr/local/etc/init.d/mysql
will be replaced with the extensions version when you reboot. If you
look in  /usr/local/etc/init.d/mysql  you'll find  datadir  is hardcoded
to  /home/tc/mysql/data  if you don't set it to something else.

I think you can override it like this:
Code: [Select]
echo -e "[mysqld]\ndatadir=/usr/local/mysql/data" > ~/.my.cnf
filetool.sh -b

As I said, /usr/local/  is not a persistent directory so  /usr/local/mysql/data
will disappear when you reboot.

Offline Yarpi

  • Newbie
  • *
  • Posts: 13
Re: Not persistent changes have become persistent! Could you help me?
« Reply #2 on: December 31, 2023, 03:34:22 PM »
Hello,

thank you for your answer, if I have well understood, /home/tc/mysql/data is the default home directory for data in mariadb and I never changed it. Why it doesn't work?

Offline Yarpi

  • Newbie
  • *
  • Posts: 13
[Solved] Not persistent changes have become persistent! Could you help me?
« Reply #3 on: January 01, 2024, 11:13:35 AM »
Yes, it is correct, every mysql version is configured to ~/mysql/data so for this reason I had to change it to what I want each time.
Thank you.