MySQL

debian-sys-maint default user for MySQL restart
cat /etc/mysql/debian.cnf
DO NOT CHANGE THE PASSWORD

restarting

restart mysqlrestart
/etc/network/interfacesstatic IP
/etc/init.d/networking restart

Optimise table (defragment)

OPTIMIZE TABLE foo
mysqlcheck -op -u root bacula
mysqlcheck -op -u root --all-databases

Useful statements

Get the newest record based on a timestamp field.
SELECT trackid FROM `table` WHERE updated=(SELECT max(updated) FROM `table` WHERE userid=8 )
SELECT trackid FROM `table` WHERE userid=8 ORDER BY updated DESC LIMIT 1




Custom Search