MySQL Connection Error
I have a different php script running via a cron and it is giving the following error [QUOTE]Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
The only way I could get the script to work was to enable "Normal Shell" in the WHM->Manage Shell Access Pete
The only way I could get the script to work was to enable "Normal Shell" in the WHM->Manage Shell Access Pete
-
Re: All of a sudden...etc/cron.hourly/modsecparse.pl:DBI connect('modsec:localhost','modsec',...) fa Hello, The error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock can be because you don't have a mysql.sock file in /var/lib/mysql (which should be symlinked to /var/tmp or /tmp). Please post the output of your /etc/my.cnf file. 0 -
Re: All of a sudden...etc/cron.hourly/modsecparse.pl:DBI connect('modsec:localhost','modsec',...) fa [quote="cPanelPeter, post: 1642342">Hello, The error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock can be because you don't have a mysql.sock file in /var/lib/mysql (which should be symlinked to /var/tmp or /tmp). Please post the output of your /etc/my.cnf file.
I have the mysql data directory on its own drive /mysql and var/lib/mysql symlinked to /mysql/mysql This is what I have in the my.cnf# The following options will be passed to all MySQL clients [client] #password = your_password port = 3306 socket = /tmp/mysql.sock # Here follows entries for some specific programs # The MySQL server [mysqld] port = 3306 socket = /tmp/mysql.sock skip-external-locking key_buffer_size = 196M max_allowed_packet = 16M ##datadir=/mysql/mysql max_connections = 700 sort_buffer_size = 4M read_buffer_size = 2M read_rnd_buffer_size = 6M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 128M local-infile=0 ## table_open_cache increased from 756, tmp_table_size and max_heap_table_size added table_open_cache = 1424 tmp_table_size = 250M max_heap_table_size = 250M # Try number of CPU's*2 for thread_concurrency thread_concurrency = 8 # Don't listen on a TCP/IP port at all. This can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! # #skip-networking # Replication Master Server (default) # binary logging is required for replication #log-bin=mysql-bin # binary logging format - mixed recommended binlog_format=mixed # required unique id between 1 and 2^32 - 1 # defaults to 1 if master-host is not set # but will not function as a master if omitted server-id = 1 [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates [myisamchk] key_buffer_size = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout
[/var/lib]# ls -alih 58196966 lrwxrwxrwx 1 root root 12 May 9 00:00 mysql -> /mysql/mysql/
[/var/lib/mysql]# ls -alih 2097553 lrwxrwxrwx 1 root root 23 May 9 00:27 mysql.sock -> ../../../tmp/mysql.sock=0 -
You can try creating "/var/cpanel/jailshell-additional-mounts" and editing the file to include the path for the custom MySQL location. Thank you. 0 -
Yes that worked even though I'm not using any jailing or SU type php modules. 0 -
[quote="patchwork, post: 1644731">Yes that worked even though I'm not using any jailing or SU type php modules.
Yes, account cron jobs are run with jailshell automatically unless normal shell access is granted to the account. Thank you.0
Please sign in to leave a comment.
Comments
5 comments