I am running Fedora 17 in a VirtualBox and after installing httpd web server and mysql-server I encountered the following problem – not initially, but later on after a restart of my VM: my web application ( written in Python and using the mysql.connector ) wasn’t able to connect to MySQL anymore. In the error_log of my web server I saw
mysql.connector.errors.InterfaceError, referer …
at the bottom and at the beginning of the chain of errors:
cannot open Packages database in /var/lib/rpm, referer: …
Google offered 975.000 search results about the latter error message but after reading a couple of confusing articles about this I gave up to find the answer there.
I decided to run a little test Python script via console and look: it worked ! Thus apparently my Python application was just unable to connect to MySQL within my web server’s environment.
I decided to stop my httpd and start it again ensuring doing so as root user. And look again: problem solved ( for now ), my web application worked !