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

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

Moderators: Developers, Moderators

Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

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

Post by Skepticalme »

Mariadb 10.3.36
Nems 1.5.2 (raspian 10)
cacti 1.2.23

When I enter

Code: Select all

vim /etc/my.cnf
I get a blank file

I'm just wondering how I can edit the /etc/my.cnf file in mariadb? Any help is appreciated

Thanks.
Last edited by Skepticalme on Mon Jan 16, 2023 6:16 pm, edited 1 time in total.
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

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

Post by Skepticalme »

Image
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

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

Post by Skepticalme »

It’s in:

Code: Select all

/etc/mysql/my.cnf
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

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

Post by Skepticalme »

Skepticalme wrote: Sat Jan 14, 2023 4:22 pm It’s in:

Code: Select all

/etc/mysql/my.cnf
Actually, that's not the file that contains the "variables" that I need to modify for the Cacti setup. The file /etc/mysql/my.cnf exists, but none of the following variables are contained within it. The file should contain collation_server, max_heap_table_size, tmp_table_size, innodb_file_format, innodb_large_prefix, innodb_buffer_pool_size, innodb_doublewrite, innodb_flush_log_at_timeout, innodb_read_io_threads, innodb_write_io_threads, innodb_buffer_pool_instances, innodb_io_capacity, innodb_io_capacity_max ... all of which I have to modify before going forward with the installation.

Image

The places I've tried:

Code: Select all

/etc/my.cnf
/etc/mysql/my.cnf
$MYSQL_HOME/my.cnf
[datadir]/my.cnf
~/.my.cnf
Thank you for any help, it's really appreciated.
User avatar
macan
Cacti Guru User
Posts: 1146
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

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

Post by macan »

mysql --help
mysql Ver 15.1 Distrib 10.5.17-MariaDB, for FreeBSD12.3 (amd64) using EditLine wrapper
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Usage: mysql [OPTIONS] [database]

Default options are read from the following files in the given order:
/usr/local/etc/mysql/my.cnf ~/.my.cnf
Let the Cacti grow!
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

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

Post by Skepticalme »

Thanks for the reply, appreciate it.

When I try those with nano each one says "new file" and they are empty.
Skepticalme
Posts: 36
Joined: Thu Jan 12, 2023 11:33 pm

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

Post by Skepticalme »

macan wrote: Mon Jan 16, 2023 3:59 am mysql --help
mysql Ver 15.1 Distrib 10.5.17-MariaDB, for FreeBSD12.3 (amd64) using EditLine wrapper
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Usage: mysql [OPTIONS] [database]

Default options are read from the following files in the given order:
/usr/local/etc/mysql/my.cnf ~/.my.cnf
This is what I see when I nano to /etc/mysql/my.cnf

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 »

Actually, that's not the file that contains the "variables" that I need to modify for the Cacti setup. The file /etc/mysql/my.cnf exists, but none of the following vari
The variables do not exist, as you need to add them manually to the [mysqld] section :-)

It may be that you actually need to edit different files. In RockyLinux/RHEL 8 you need to add these variables to /etc/my.cnf.d/mariadb-server.cnf Not sure about your system though.
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 7:22 am
Actually, that's not the file that contains the "variables" that I need to modify for the Cacti setup. The file /etc/mysql/my.cnf exists, but none of the following vari
The variables do not exist, as you need to add them manually to the [mysqld] section :-)

It may be that you actually need to edit different files. In RockyLinux/RHEL 8 you need to add these variables to /etc/my.cnf.d/mariadb-server.cnf Not sure about your system though.
I have found:

Code: Select all

/etc/mysql/my.cnf
and

Code: Select all

/etc/mysql/mariadb.cnf
Both of these look exactly the same when I open the files (the image above). I do not know where else to look other that the /etc/mysql directory

Code: Select all

admin@nems:~ $ cd /etc/mysql
admin@nems:/etc/mysql $ ls
conf.d  debian.cnf  debian-start  mariadb.cnf  mariadb.conf.d  my.cnf  my.cnf.fallback
This is what the files look like:

Image

Would it be possible for you to give me an example of what to type? For example, do I have to create the [mysql] section myself, and then add max_heap_table_size=30.3M below it?

Would it look like this:

Code: Select all

[mysql]

max_heap_table_size=30.3M
Sorry for the complete noob questions, I'm only just now learning the command line, it's why I purchased a Raspberry Pi.
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 is in this directory:

Code: Select all

mariadb.conf.d 
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 7:56 am What is in this directory:

Code: Select all

mariadb.conf.d 

Code: Select all

admin@nems:~ $ cd /etc/mysql
admin@nems:/etc/mysql $ ls
conf.d  debian.cnf  debian-start  mariadb.cnf  mariadb.conf.d  my.cnf  my.cnf.fallback
admin@nems:/etc/mysql $ cd /etc/mysql/mariadb.conf.d
admin@nems:/etc/mysql/mariadb.conf.d $ ls
50-client.cnf  50-mysql-clients.cnf  50-mysqld_safe.cnf  50-server.cnf
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 file looks about right:

Code: Select all

50-server.cnf
There should be a [mysqld] thing in there with a few variables.
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:05 am That file looks about right:

Code: Select all

50-server.cnf
There should be a [mysqld] thing in there with a few variables.
There sure is!Just the [mysql] section but it has nothing underneath of it.

Would I write the following as(under the [mysql]):

Code: Select all

max_heap_table_size=30.3M
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 »

no. Can you paste the content of the file in here ?
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:09 am no. Can you paste the content of the file in here ?

Code: Select all

#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql

# this is read by the standalone daemon and embedded servers
[server]

# this is only for the mysqld standalone daemon
[mysqld]

#
# * Basic Settings
#
user                    = mysql
pid-file                = /run/mysqld/mysqld.pid
socket                  = /run/mysqld/mysqld.sock
#port                   = 3306
basedir                 = /usr
datadir                 = /var/lib/mysql
tmpdir                  = /tmp
lc-messages-dir         = /usr/share/mysql
#skip-external-locking

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1

#
# * Fine Tuning
#
#key_buffer_size        = 16M
#max_allowed_packet     = 16M
#thread_stack           = 192K
#thread_cache_size      = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
#myisam_recover_options = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
This isn't all of it because I can't seem to copy all of the content due to the terminal being in a browser
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests