13

I have MySQL 5.6 installed on Windows 7 64 Bit and I can't seem to get it to read my my.ini file. I've put the file into the base installation directory, the Windows directory and C:\, but it doesn't look like it's being read, even though all paths are listed here: http://dev.mysql.com/doc/refman/5.1/en/option-files.html

My my.ini file doesn't do much, I just took the my-default.ini as a base and added [mysqld] max_allowed_packet=100000000 because that default limit of 4MB is bad for BLOBs.

When I start mysql.exe and check the variable I find that it's still at 4MB, even after restarting the server (both via the services menu in the control panel and via mysqld -shutdown + mysqld -startup) and restarting Windows.

I have Windows 7, 64 bit. Can anyone help me, please?

Thanks in advance!

Alex

Alex
  • 1,198
  • 2
  • 12
  • 26
  • I am also having this problem. Feel pretty silly about it. I verified the path from mysql.exe --help is where I named/put the file, no go. – Nick Spacek Sep 26 '13 at 13:27
  • it's about the right time to choose a correct answer (: – IAfanasov May 20 '20 at 18:47
  • 1
    Hehe, I haven't been back here in forever. I still haven't verified it, because my comment below Kosmous' answer is still true, but the community seems to agree, so here you go. – Alex May 21 '20 at 23:47

5 Answers5

19

I faced the same issue. In my case service was using my.ini from another path (C:\ProgramData\MySQL\MySQL Server 5.6\my.ini). You can check it by examing the properties of MySQLServer service in services.msc.

IAfanasov
  • 4,775
  • 3
  • 27
  • 42
  • Thank you. I had the exact same problem and was getting very frustrated when none of my changes had the slightest effect! Because of your solution I went from > 40% memory usage down to 4%. My server is alive again! – Reinstate Monica Cellio May 05 '15 at 11:29
  • 1
    Especially frustrating given that this contradicts the advice listed in `mysql --help` – Marc L. Mar 07 '19 at 20:27
11

In MySQL Server 5.6 the my.ini location is under ProgramData "C:\ProgramData\MySQL\MySQL Server 5.6" not in the installation folder under programs files.

Be careful to what Kosmous says. don't add a new line and forget the old one and don't forget to restart the service.

Gamal Mohamed
  • 111
  • 1
  • 3
3

I got the same exact problem and the solution you posted from the other thread was kinda convoluted and it wasn't really solving the actual issue. I'm sure you did the same thing as me and added max_allowed_packet = 32M or whatever right under [mysqld] like every site says. Although this is perfectly correct, people forgot to mention and it took me a week to finally realize that there was already a default max_allowed_packet = 4M in the default my.ini file. I totally didn't notice this because each line of [mysqld] is so heavily commented. Obviously, since the original max_allowed_packet = 4M was like 2 pages down from [mysqld] header, it overrode any setting you manually inserted.

Kosmous
  • 31
  • 2
  • Thanks for the reply! I haven't been working with databases for quite a few months now and I'm too lazy to reinstall everything just to verify it. It might be a solution, but I am generally a type of person who does keyword searches in files way before having convoluted discussions, so I believe in my case it's unlikely to be the cause. I mean, my new limit did work after reinstalling the server, so no overriding happened then. – Alex Jul 25 '14 at 20:53
  • Oh ffs, this solved it for me. There are two `port=NNNN` directives in my.ini, one for client the other for server. The lesson is, pay attention to what **section in my.ini** you're in. – Bob Stein Apr 11 '19 at 02:10
1

I started another thread at the MySQL forums and a patient user was able to help me out:

http://forums.mysql.com/read.php?10,595697,595697#msg-595697

It's not the most satisfying solution because it essentially means reinstalling the server manually whenever you want to change something in the my.ini file, but at least it works somehow.

Alex
  • 1,198
  • 2
  • 12
  • 26
0

Sharing my findings after lot of wasted time. I should always remember to read the manual first This is right out of the manual. In my case the my.ini file was under C:\ProgramData\MySQL

[1]: https://i.stack.imgur.com/LIdVr.png

More information can be found below https://dev.mysql.com/doc/refman/5.7/en/option-files.html

virtuvious
  • 2,362
  • 2
  • 21
  • 22