Category Archives: Databases

MySQL: Disable AppArmor To Fix Permissions Problems

# mv /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/.usr.sbin.mysqld # /etc/init.d/apparmor restart # /etc/init.d/apparmor status

Posted in Databases | Tagged , | Leave a comment

MySQL: How To Convert UTC to Local Time

mysql> select convert_tz( ’2011-04-24 06:53:56′, ‘+00:00′, ‘-07:00′); +——————————————————–+ | convert_tz( ’2011-04-24 06:53:56′, ‘+00:00′, ‘-07:00′) | +——————————————————–+ | 2011-04-23 23:53:56 | +——————————————————–+ 1 row in set (0.00 sec) Also… mysql> select convert_tz( ’2011-04-24 06:53:56′, ‘+00:00′, ‘SYSTEM’); +——————————————————–+ | convert_tz( ’2011-04-24 06:53:56′, … Continue reading

Posted in Databases | Tagged , , , | 1 Comment

Perl/MySQL: How To Disable Foreign Key Checking

$dbh->do(‘SET FOREIGN_KEY_CHECKS=0′);

Posted in Databases | Leave a comment

Postgres Command Reference

General \c[onnect] [DBNAME|- [USER]] connect to new database (currently “postgres”) \cd [DIR] change the current working directory \copyright show PostgreSQL usage and distribution terms \encoding [ENCODING] show or set client encoding \h [NAME] help on syntax of SQL commands, * … Continue reading

Posted in Databases, Linux | Leave a comment

Unix: How to Install BerkeleyDB From Source

This documentation is buried in the source as HTML, so I’m posting it here for convenience. Building for UNIX/POSIX The Berkeley DB distribution builds up to four separate libraries: the base C API Berkeley DB library and the optional C++, … Continue reading

Posted in Databases, Linux | Leave a comment