Being used to using XAMPP for Windows, when I migrated to Ubuntu, I installed XAMPP for Linux (LAMPP). The only draw-back is that programs that need MySQL and don’t allow you to locate the sock file manually (like AmaroK) will complain and not let you use MySQL as a storage alternative.
For this, I learned about symlinks (symbolic links). But, since the fake mysqld directory always gets deleted by the time I log back in, I had to create a bash script that will run on boot and won’t require me to use sudo or put my password, it runs as root.
First, we create the script:
Then, our script is extremely simple:
#!/bin/bash mkdir /var/run/mysqld ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
Now we make it executable and we move it to the init.d directory:
chmod +x mysql_link.sh sudo mv mysql_link.sh /etc/init.d
And, now, we add it to be executed on boot time:
sudo update-rc.d mysql_link.sh defaults
Note that we didn’t add the full path to it.
Anyway, we can even do the same to start LAMPP on startup (in the same script or a different one, depending on your particular needs.)