I have multiple mysql instances running on my Red Hat server. The instance I created for Omeka is mysqld2 with mysql2.sock at port 3308. I can’t figure out how to point Omeka to this specific instance of mysql. Has anyone done this? I’m getting the error - Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ But of course that is because it needs to connect to mysql2.sock.
What have you tried? There are configuration options for both port and unix_socket in the database configuration file for Omeka S.
Generally, the unix socket will only be used if you give the host literally as “localhost,” to use the port number instead you’d want to specify the host as “127.0.0.1” (the IP address for localhost). The unix_socket parameter should work fine with localhost, though.
Is the socket actually at /var/lib/mysql/mysql2.sock ?
You’ve left that line commented out so it won’t have any effect (that’s what the leading semicolon means, so remove that if you’re intending to set the unix_socket line, or port or log_path for that matter).
Thanks, I did not realize semicolons were used to comment out lines. I removed them but nothiong changed.
Yes, mysql2.sock is under /var/lib/mysql and it is declared in my.cnf. But according to the error message, the process is trying to use mysql.sock, not mysql2.sock. It does not seem to be reading the database.ini file under config.