diff --git a/include/my_global.h b/include/my_global.h index 779152203be..e4e53aca20a 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -751,7 +751,7 @@ typedef SOCKET_SIZE_TYPE size_socket; #endif #define MY_NFILE 64 /* This is only used to save filenames */ #ifndef OS_FILE_LIMIT -#define OS_FILE_LIMIT 65535 +#define OS_FILE_LIMIT UINT_MAX #endif /* #define EXT_IN_LIBNAME */ diff --git a/mysys/my_file.c b/mysys/my_file.c index 44bacf55307..d37da975c37 100644 --- a/mysys/my_file.c +++ b/mysys/my_file.c @@ -72,7 +72,7 @@ static uint set_max_open_files(uint max_file_limit) } #else -static int set_max_open_files(uint max_file_limit) +static uint set_max_open_files(uint max_file_limit) { /* We don't know the limit. Return best guess */ return min(max_file_limit, OS_FILE_LIMIT); diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 23b5efcaf2b..e4e5f1a1510 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -183,6 +183,7 @@ parse_arguments() { ;; --nice=*) niceness="$val" ;; --open-files-limit=*) open_files="$val" ;; + --open_files_limit=*) open_files="$val" ;; --skip-kill-mysqld*) KILL_MYSQLD=0 ;; --syslog) want_syslog=1 ;; --skip-syslog) want_syslog=0 ;; @@ -397,10 +398,14 @@ then if test -n "$open_files" then ulimit -n $open_files - append_arg_to_args "--open-files-limit=$open_files" fi fi +if test -n "$open_files" +then + append_arg_to_args "--open-files-limit=$open_files" +fi + safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} # Make sure that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port`