-- select 10 random row from table SELECT column FROM TABLE ORDER BY rand() limit 10 -- view all databases show databases; -- view tables from database show tables FROM mysql; -- timestamp 7 days ago date_sub(curdate(), INTERVAL 7 DAY); -- format date SELECT TO_CHAR(TIME, 'YYYY-MM-DD HH24:MI') FROM LOG; -- replace first char to upercase UPDATE customer SET first_name = CONCAT(UPPER(LEFT(first_name, 1)), SUBSTRING(first_name, 2));
DB Clients
http://www.squirrelsql.org - SQuirreL SQL, universal SQL Client, supports MS SQL and other DB
Connect from OpenOffice / LibreOffice to MsSQL Server
http://www.oooforum.org/forum/viewtopic.phtml?t=24036
Login
mysql -u root -p
Links
phpMyAdmin - phpMyAdmin downloads
GUI
apt-get install -y mysql-admin
Allow access from outsice
sed -i 's|bind-address|#bind-address|g' /etc/mysql/my.cnf
/etc/init.d/mysql restart
Allow access to database magento for user dbo_magento from any host
GRANT ALL PRIVILEGES ON magento.* TO dbo_magento@'%' IDENTIFIED BY 'your_pass'
Links