Importing Large Database Error

Hello.

We use the Windows SQLyog software and try to import a large database but the following error happens.

Error Code: 1153 - Got a packet bigger than ‘max_allowed_packet’ bytes

I know there are other topics to increase the max upload size but is for the php only and reflects the phpmyadmin import procedure.

We want to change the config from mariadb server to allow bigger db uploads but the my.cnf file on /etc/my.cnf is empty.

How to resolve this?

Thank you.

Please provide these details Bug Report Template - Bug Report - CyberPanel Community

Provider: Upcloud

System: Centos 7.5

OLS or Enterprise?
OLS

Installing from official server or mirror server?
official

Replace JS/CSS files to JS Delivr?
no

Install Memcached extension for PHP?
yes

Install LiteSpeed Memcached?
yes

Install Memcached?
yes

Install Redis extension for PHP?
yes

Install Redis?
yes

Problem:

I want to edit the mariadb my.cnf file to tweak the max_allowed_packet so that we can increase it to import a large database file.

We use the software SQLyog to connect to database but when we try to import the sql file it throws an Error Code: 1153 - Got a packet bigger than ‘max_allowed_packet’ bytes

We want to increase the max_allowed_packet from mariadb config file but we can’t find it anywhere. The file it exists on /etc/my.cnf but is empty and doesn’t have the default values every my.cnf file has.

How to edit this value?

Thank you.

https://cyberpanel.net/docs/mysql-optimization-on-cyberpanel/

Try this guide, you will have your my.cnf populated, you can then adjust accordingly.

Platform services have been discontinued temporarily.
What other solution do we have? Thank you

@michaelrp
mysql -u username -p database_name < data.sql
it will prompt for the password and it will import the data

@JonathanDHN told me to use: (copy all the 4 following lines in console)

sudo cat > /etc/mysql/mariadb.conf.d/50-custom.cnf <<EOF
[mysqld]
max_allowed_packet = 64M
EOF

THEN:
sudo systemctl restart mariadb