i’m run on Macos 10.15.5, with mariadb 10.4.13.
Since i did “brew upgrade” I have this error :
Out of resources when opening file './pluto/_connection.MYD' (Errcode: 24 "Too many open files")
I tried to modify this file /usr/local/etc/my.cnf to add this line open_files_limit = 60000
but it doesn’t work, open_files_limit variable still blocked on the value 256.
I tried this line : sudo ulimit -n 1024
, but each time I restart the value returns to 256
Do you have any help to bring me to help me solve my problem?
A simple fix for the "too many files open" limitation of Mac OS is to use the "ulimit - n" command. Curiously, the value of n appears to be critical to whether or not this command is accepted by MacOS. I've found that ulimit -n 10240 (the default is 256) works but n values higher do not.
The default max open file limits on recent mac os is 10240 .
Have you tried looking for other ways to modify the open files limit on MacOS Catalina? A quick search led me to here which suggests the following for modifying it for the system while it is running:
sudo launchctl limit maxfiles <soft limit> <hard limit>
This site and this superuser question suggests to modify /Library/LaunchDaemons/limit.maxfiles.plist
to permanantly increase it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
<string>maxfiles</string>
<string><your soft limit here></string>
<string><your hard limit here></string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
</dict>
</plist>
Then, finish up by changing permissions and verifying the change.
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
launchctl limit maxfiles
Importing database with mysql < foo.sql
fails with: [ERROR] Error in accept: Too many open files
Agree with the posts above. This looks like a false negative. This is what worked for me:
brew services stop mariadb
And make sure you do not have any mysql processes running: ps aux | grep mysql
.
mkdir /usr/local/var/run/mysqld
Edit Mariadb config file /usr/local/etc/my.cnf
and tell it to use this directory.
[client-server]
socket = /usr/local/var/run/mysqld/mysql.sock
[mysqld_safe]
pid-file = /usr/local/var/run/mysqld/mysqld.pid
Strictly speaking you do you only need to define the pid file, though I personally like to store both pid and socket files inside the /usr/local/var/run
- structure. I do the same for PHP (/usr/local/var/run/php) installed from Homebrew.
Start you database server and you are done.
brew services start mariadb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With