Drupal 7 and MySQL sockets

I recently switched from a implementation of MySQL to MacPorts on my local, and the Drupal sites would no longer load.

The MacPorts my.cnf file turns off networking, so that multiple versions of MySQL can be run. In doing so, one must then use socket files to access MySQL instead of TCP/IP. This requires a change to the database config in the settings.php file.

Simply add the path to your socket file as an additional line in the database config array, as follows:

'unix_socket' => '/<path>/mysqld.sock'

MacPorts and The server quit without updating PID file

I just upgraded from OS X Mavericks to Yosemite, and then went through the process of updating my MacPorts ports. Everything went cleanly until I tried to start MySQL. I received the message:

The server quit without updating PID

Searching for an answer gave plenty of articles suggesting that the file mentioned after that error message needed to be created, that permissions were wrong, and other things surrounding issues regarding the pid file. None of those turned out to be the cause.

Drupal and permissions - avoiding 'The directory sites/default/files is not writable' error

Have you moved a Drupal site to another server and received the error 'The directory sites/default/files is not writable' ?  The site worked on the previous server, and the permissions seem the same. Ah, an easy fix...make the permissions for the files directory 777. Noooo!

Let's take a look at what the numbers in the permissions setting mean.

Dumping a Single MySQL Table

I recently needed to test out some new code on my local version of a client's site. I ran into a problem, because keys and information that I needed for the testing were in the live version of the database, but not in my version. I needed to import new data, but this was a huge database, so I only wanted the one table rather than the entire database.

I could use phpMyAdmin for the export, and for the import, but while it is a great tool, it can be as slow as molasses when it comes importing data, not to mention the file size and execution time limits that can be a wall

Subscribe to mysql