How to edit /etc/my.cnf? [SOLVED]

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: How to edit /etc/my.cnf?

Post by phalek »

That's exactly the part where you need to add these variables to:

Code: Select all

# this is only for the mysqld standalone daemon
[mysqld]
...
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: How to edit /etc/my.cnf?

Post by Skepticalme »

I did the following:

Image
And when I try to restart mariadb I get the following result.

Code: Select all

admin@nems:~ $ sudo systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

Code: Select all

admin@nems:~$ systemctl status mariadb.service

Code: Select all

● mariadb.service - MariaDB 10.3.22 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2023-01-17 00:47:48 AEDT; 56s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 2849 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
  Process: 2850 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 2852 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: 2931 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
 Main PID: 2931 (code=exited, status=1/FAILURE)

Also, there are InnoDB variables, lots of them, do they go into the same [mysql] section?

Thanks again.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: How to edit /etc/my.cnf?

Post by phalek »

What does the other command "journalctl -xe" return ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: How to edit /etc/my.cnf?

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 8:59 am What does the other command "journalctl -xe" return ?


Image
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: How to edit /etc/my.cnf?

Post by phalek »

you need to restart mysql/mariadb first before executing the command :-)
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: How to edit /etc/my.cnf?

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 9:07 am you need to restart mysql/mariadb first before executing the command :-)
Sorry! This looks different.

Image


I can't seem to restart mysql/mariadb
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: How to edit /etc/my.cnf?

Post by phalek »

Ok, doesn't tell here.

Check /var/log for any mysql/mariadb logs, then check what errors are in there
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: How to edit /etc/my.cnf?

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 9:16 am Ok, doesn't tell here.

Check /var/log for any mysql/mariadb logs, then check what errors are in there
Now I'm confused. Sorry for this mess.

Code: Select all

admin@nems:/var/log $ less /var/log/mysql/errorlog.1
/var/log/mysql/errorlog.1: Permission denied
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: How to edit /etc/my.cnf?

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 9:16 am Ok, doesn't tell here.

Check /var/log for any mysql/mariadb logs, then check what errors are in there

Code: Select all

admin@nems:/var/log $ cd /var/log/mysql
bash: cd: /var/log/mysql: Permission denied
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: How to edit /etc/my.cnf?

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 9:16 am Ok, doesn't tell here.

Check /var/log for any mysql/mariadb logs, then check what errors are in there
I put a hash in front of the variables again and MariaDB is working again but of course, I'm back to the original problem.

Image
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: How to edit /etc/my.cnf?

Post by phalek »

you should be "root" or do a "sudo cat /var/log/mysql/errorlog" thing.

You can enable the variables one-by-one though, then restartt mariadb and check if it does. Then go back enable the next one until mariadb does not start again.
Then skip/comment that variable again and take the next one until it starts with most variables uncommented except the ones that prevent it from starting
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

Re: How to edit /etc/my.cnf?

Post by Skepticalme »

phalek wrote: Mon Jan 16, 2023 9:40 am you should be "root" or do a "sudo cat /var/log/mysql/errorlog" thing.

You can enable the variables one-by-one though, then restartt mariadb and check if it does. Then go back enable the next one until mariadb does not start again.
Then skip/comment that variable again and take the next one until it starts with most variables uncommented except the ones that prevent it from starting
The problem was that one of the variables was recommended to be set to 30.3 M, and MariaDB didn't like the ".3" ... so I removed it and input 31M and it solved the issue. Everything is done now. Thank you very much for your help and patience.

Code: Select all

max_heap_table_size	 12 M	>=	30.3 M
User avatar
TheWitness
Developer
Posts: 17059
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: How to edit /etc/my.cnf? [SOLVED]

Post by TheWitness »

MySQL is bad about fractional M and G limits. Decimal points not allowed. Silly MySQL/MariaDB.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests