Notes on Java, Solaris, PHP, LDAP…

November 17, 2007

MySQL MAMP

Filed under: Uncategorized — negev @ 9:37 pm
Tags:

17 July 07
MAMP (AMP for Mac OS X) and graphics library error: Symbol not found: __cg_jpeg_resync_to_restart
– follow http://forum.mamp.info/viewtopic.php?p=4213
— comment out both lines in /Applications/MAMP/Library/bin/envvars

MySQL counting of associations grouped by the number of occurrences
SELECT count(*), agency_id FROM positions WHERE active_flag=1 GROUP BY agency_id;

– be careful though: following 2 queries give different results:
SELECT count(*), agency_id FROM positions WHERE active_flag=1 AND agency_id IN (SELECT id FROM agencies WHERE disposition=’live’) GROUP BY agency_id;
–> a lot of small sum results
SELECT count(*), agency_id FROM positions WHERE active_flag=1 GROUP BY agency_id AND agency_id IN (SELECT id FROM agencies WHERE disposition=’live’);
–> a few big cumulated results

MySQL dump when you don’t have lock rights to the tables:
mysqldump –lock-tables=FALSE

Setting old-style MySQL passwords:
GRANT SELECT , SHOW DATABASES ON * . * TO ‘readonly’@’%’
IDENTIFIED BY ‘readonly’
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 ;

SET PASSWORD FOR ‘readonly’@’%’= OLD_PASSWORD(‘readonly’);

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: