Hey everyone!
I'm in a pickle this evening after getting my mail server setup nicely. I was trying to increase "max_packet_size" from default: 16777216 to 26214400
This is how I accidently broke my Maria DB 10.5.x (Inside a Jail):
If this wasn't bad enough; I added 1 line to /usr/local/etc/mysql/my.cnf which looks like:
Before 1 Line Add:
After 1 Line Add:
I then went to restart my MariaDB server with:
This was my moment of Doom!
*Dark and Ominous Music Plays*... lol
This is my error message:
I tried two ways to "merge" the files. my.cnf and conf.d/server.cnf:
1) Copy the 3 lines used in my.cnf to conf.d/server.cnf (Where they are # commented out due to the my.cnf entries), this includes the !include line for /conf.d/*
2) Copied server.cnf to my.cnf
This is the contents of /usr/local/etc/mysql/conf.d/server.cnf:
Restarted and the same error!
Using tail on the the /var/log/mysql/mysqld.err reveals:
I have since put it exactly back to where it was (the files) with a broken MariaDB 10.5 Server and all my SQL Data is in Jeopardy!
If Anyone has any idea how to fix this without losing MySQL/MariaDB Data (I have hundreds of databases inside); I would really appreciate it! Thank you everyone, as always, For FreeBSD, This Community and All Assistance, Learning Assistance!
Best Regards,
Brandon!
I'm in a pickle this evening after getting my mail server setup nicely. I was trying to increase "max_packet_size" from default: 16777216 to 26214400
This is how I accidently broke my Maria DB 10.5.x (Inside a Jail):
Code:
root@jail:~ # mysql -h mariadbserver_ip -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 232822
Server version: 10.5.15-MariaDB FreeBSD Ports
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
root@mariadbserver_ip [(none)]> show variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set (0.001 sec)
root@mariadbserver_ip [(none)]> SET GLOBAL max_allowed_packet="26214400";
ERROR 1232 (42000): Incorrect argument type to variable 'max_allowed_packet'
root@mariadbserver_ip [(none)]> SET GLOBAL --max-allowed-packet=26214400;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '--max-allowed-packet=26214400' at line 1
root@mariadbserver_ip [(none)]> --max-allowed-packet=26214400;
root@mariadbserver_ip [(none)]> show variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set (0.002 sec)
root@mariadbserver_ip [(none)]> --max-allowed-packet=26214400
root@mariadbserver_ip [(none)]> show variables like 'max_allowed_packet';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 16777216 |
+--------------------+----------+
1 row in set (0.001 sec)
root@mariadbserver_ip [(none)]> set global max_allowed_packet=26214400 max_allowed_packet;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'max_allowed_packet' at line 1
root@mariadbserver_ip [(none)]> set global max_allowed_packet=26214400;
Query OK, 0 rows affected (0.009 sec)
root@mariadbserver_ip [(none)]>
If this wasn't bad enough; I added 1 line to /usr/local/etc/mysql/my.cnf which looks like:
Before 1 Line Add:
Code:
#
# This group is read both by the client and the server
# use it for options that affect everything, see
# https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#option-groups
#
[client-server]
port = 3306
socket = /var/run/mysql/mysql.sock
#
# include *.cnf from the config directory
#
!includedir /usr/local/etc/mysql/conf.d/
After 1 Line Add:
Code:
#
# This group is read both by the client and the server
# use it for options that affect everything, see
# https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#option-groups
#
[client-server]
port = 3306
socket = /var/run/mysql/mysql.sock
max_packet_size = 26214400
#
# include *.cnf from the config directory
#
!includedir /usr/local/etc/mysql/conf.d/
I then went to restart my MariaDB server with:
Code:
# service mysql-server restart
This was my moment of Doom!
*Dark and Ominous Music Plays*... lol
This is my error message:
Code:
Please merge existing /usr/local/etc/my.cnf file with /usr/local/etc/mysql/conf.d/server.cnf
/usr/local/etc/rc.d/mysql-server: WARNING: failed precmd routine for mysql
I tried two ways to "merge" the files. my.cnf and conf.d/server.cnf:
1) Copy the 3 lines used in my.cnf to conf.d/server.cnf (Where they are # commented out due to the my.cnf entries), this includes the !include line for /conf.d/*
2) Copied server.cnf to my.cnf
This is the contents of /usr/local/etc/mysql/conf.d/server.cnf:
Code:
# Options specific to server applications, see
# https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#server-option-groups
# Options specific to all server programs
[server]
# Options specific to MariaDB server programs
[server-mariadb]
#
# Options for specific server tools
#
[mysqld]
user = mysql
# port = 3306 # inherited from /usr/local/etc/mysql/my.cnf
# socket = /var/run/mysql/mysql.sock # inherited from /usr/local/etc/mysql/my.cnf
#bind-address = 127.0.0.1
#bind-address = 0.0.0.0
bind-address = mariadbserverip
basedir = /usr/local
datadir = /var/db/mysql
net_retry_count = 16384
log_error = /var/log/mysql/mysqld.err
# [mysqld] configuration for ZFS
# From https://www.percona.com/resources/technical-presentations/zfs-mysql-percona-technical-webinar
# Create separate datasets for data and logs, eg
# zroot/mysql compression=on recordsize=128k atime=off
# zroot/mysql/data recordsize=16k
# zroot/mysql/data recordsize=16k
# zroot/mysql/logs
# datadir = /var/db/mysql/data
# innodb_log_group_home_dir = /var/db/mysql/log
# audit_log_file = /var/db/mysql/log/audit.log
# general_log_file = /var/db/mysql/log/general.log
# log_bin = /var/db/mysql/log/mysql-bin
# relay_log = /var/db/mysql/log/relay-log
# slow_query_log_file = /var/db/mysql/log/slow.log
# innodb_doublewrite = 0
# innodb_flush_method = O_DSYNC
# Options read by `mysqld_safe`
# Renamed from [mysqld_safe] starting with MariaDB 10.4.6.
[mariadb_safe]
# Options read my `mariabackup`
[mariabackup]
# Options read by `mysql_upgrade`
# Renamed from [mysql_upgrade] starting with MariaDB 10.4.6.
[mariadb-upgrade]
# Specific options read by the mariabackup SST method
[sst]
# Options read by `mysqlbinlog`
# Renamed from [mysqlbinlog] starting with MariaDB 10.4.6.
[mariadb-binlog]
# Options read by `mysqladmin`
# Renamed from [mysqladmin] starting with MariaDB 10.4.6.
[mariadb-admin]
Restarted and the same error!
Using tail on the the /var/log/mysql/mysqld.err reveals:
Code:
root@mariadb:/usr/local/etc/mysql/conf.d # cd /var/log/mysql
root@mariadb:/var/log/mysql # ls -l
total 537
-rw-rw---- 1 mysql mysql 5243934 May 2 01:50 mysqld.err
root@mariadb:/var/log/mysql # tail mysqld.err
2022-05-02 1:49:59 0 [Note] Event Scheduler: Purging the queue. 0 events
2022-05-02 1:49:59 0 [Note] InnoDB: FTS optimize thread exiting.
2022-05-02 1:50:01 0 [Note] InnoDB: Starting shutdown...
2022-05-02 1:50:01 0 [Note] InnoDB: Dumping buffer pool(s) to /var/db/mysql/ib_buffer_pool
2022-05-02 1:50:01 0 [Note] InnoDB: Restricted to 2016 pages due to innodb_buf_pool_dump_pct=25
2022-05-02 1:50:01 0 [Note] InnoDB: Buffer pool(s) dump completed at 220502 1:50:01
2022-05-02 1:50:25 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-05-02 1:50:25 0 [Note] InnoDB: Shutdown completed; log sequence number 724778545770; transaction id 118829080
2022-05-02 1:50:25 0 [Note] /usr/local/libexec/mariadbd: Shutdown complete
root@mariadb:/var/log/mysql #
I have since put it exactly back to where it was (the files) with a broken MariaDB 10.5 Server and all my SQL Data is in Jeopardy!
If Anyone has any idea how to fix this without losing MySQL/MariaDB Data (I have hundreds of databases inside); I would really appreciate it! Thank you everyone, as always, For FreeBSD, This Community and All Assistance, Learning Assistance!
Best Regards,
Brandon!