# How to set variables in perconamysql

**URL:** <https://forums.percona.com/t/how-to-set-variables-in-perconamysql/5397>\
**Category:** Other MySQL® Questions\
**Created:** [February 6, 2017, 3:57am UTC](https://forums.percona.com/t/how-to-set-variables-in-perconamysql/5397 "2017-02-06T03:57:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dismipaul](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@dismipaul](https://forums.percona.com/u/dismipaul)\
**Post date:** [February 6, 2017, 3:57am UTC](https://forums.percona.com/t/how-to-set-variables-in-perconamysql/5397/1 "2017-02-06T03:57:22Z")

</div>

Team,

I noticed that percona does not have a my.cnf file by default like MySQL does.  
I tried to add one with minimal changes to increase the packet limit, but the service restart failed.

I was able to start again without the my.cnf changes and make a global setting change, but I don’t think this will persist across service restarts. Is there any way to get this setting to work in a my.cnf file?  
There are 6-8 settings we typically run with here, and not sure what other issues we might run into without these other settings.

The commands I used to update the packet limit were:

mysql\> show global variables like ‘max\_allowed\_packet’;  
±-------------------±--------+  
| Variable\_name | Value |  
±-------------------±--------+  
| max\_allowed\_packet | 1048576 |  
±-------------------±--------+  
1 row in set (0.00 sec)

mysql\> set global max\_allowed\_packet=104857600;  
Query OK, 0 rows affected (0.00 sec)

mysql\> show global variables like ‘max\_allowed\_packet’;  
±-------------------±----------+  
| Variable\_name | Value |  
±-------------------±----------+  
| max\_allowed\_packet | 104857600 |  
±-------------------±----------+  
1 row in set (0.00 sec)

These are the other setting used in past testing with MySQL and how to set the below variables in percona?

[mysqld]

innodb\_buffer\_pool\_size = 256M

query\_cache\_type = 1  
query\_cache\_limit = 1M  
query\_cache\_size = 32M

tmp\_table\_size = 32M  
max\_heap\_table\_size = 32M  
max\_connections = 500  
thread\_cache\_size = 50  
open\_files\_limit = 65535  
table\_definition\_cache = 4096  
table\_open\_cache = 512

max\_connections = 300  
max\_allowed\_packet = 100M

Thanks,  
Dismi

---

<div class="post-metadata">

**Author:** ![jrivera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jrivera/32/13_2.png) [@jrivera](https://forums.percona.com/u/jrivera)\
**Post date:** [February 8, 2017, 6:00am UTC](https://forums.percona.com/t/how-to-set-variables-in-perconamysql/5397/2 "2017-02-08T06:00:05Z")

</div>

Percona Server can use the same my.cnf file you’ve been using for Oracle MySQL Server, put your my.cnf on the default location (eg /etc/) and restart Percona Server and it should use the configs on your my.cnf.
