Quantcast
Browsing all 35 articles
Browse latest View live

Slow Query Extract

// A cron to send extract of slow query log of 3 different servers by mail every day. Change the email address. It is assumed that the keys are saved to login to different servers.<code> 35 23 *...

View Article


Compare Engines

// If you have 2 servers with identical database structure, and some of the tables have different engine type, then create a federated table to connect to the original server and compare the engines...

View Article


Proper Case

// To make it work with strings long than 128 characters, change its input and return declarations accordingly.<code> DROP FUNCTION IF EXISTS proper; SET GLOBAL...

View Article

Monthly Partitions

// create to_days(first_day), to_days(second_day) syntax that can be directly used while creating partitions based on month. Create a table in the test database with the name "date_helper" mysql>...

View Article

Mysql Proxy To Log Failed Queries

// install and start mysql proxy that will log failed queries<code> #!/bin/sh # kill the current proxy if any ps aux | grep "mysql-proxy" | awk '{print "kill -9 ", $2}' | sh # download and...

View Article


MySQL PHP search: four-part video tutorial series

Fresh from Adam Khoury's massive library of instructional videos comes a four-part, full-fledged tutorial on searching a MySQL database using PHP.The tutorials use the 'worked example' format (like...

View Article

Tutorial Series: Using PHP's MySQLi API

MySQL and PHP work wonders together, but sometimes getting them to talk can be a little less than obvious.The official documentation of MySQLi, the improved MySQL API for PHP 5.0 and MySQL 4.1, can be...

View Article

Get Birthday From Timestamp Field

//demonstra com seleccionar todos os aniversários que ocorrerão de hoje a 15 dias //faça cache deste dados <code> SELECT SQL_CACHE /*??? prefira memcache, APC, etc..*/ name, birthday,...

View Article


PHP Sessions on Steroids

Hello.Hello.I am looking for the broccoli.It's over there.Hello.Hello.I am looking for the spinach.It's next to the broccoli.What's broccoli?If conversations went like this, everybody would hate their...

View Article


Change Ownership Of Definer And Triggers

// change definer and triggers to 'root'@'localhost'<code> #!/bin/sh host='localhost' user='root' port='3306' # following should be the root@localhost password password='root@123' # triggers...

View Article

Select Randomly Row Fast - PHP Mysql

PHP MySQL Select Row Randomly Fast<code><?php //CODE FROM WWW.GREGGDEV.COM function random_row($table, $column) { $max_sql = "SELECT max(" . $column . ") AS max_id FROM " . $table; $max_row =...

View Article

Calling with PHP Variables in MongoDB

So I’ve been doing a lot of work, for work, in MongoDB lately and I’ve learned an awful lot.  Or, depending on your point of view, a lot that’s just awful.See, there’s not what you could even...

View Article

A How-to Guide for Hosting on OpenShift

I’ve recently moved this blog to run on WordPress running on RedHat’s OpenShift Express. If you’ve not heard of OpenShift, it’s: Preview Text:  Including how to install the client tools, create a...

View Article


Defining Dynamic Assets - PHP Project pt. II

I am currently working on a feature of a project that allows users to track assets that exist at a location. The interesting part of the feature is that an asset can be almost anything, and that the...

View Article

Book: PHP and MongoDB Web Development

What makes a beginner’s guide handy is when it speaks to your intuition. It anticipates the burning questions that follow from a newbie trying to grasp new concepts and it quickly answers them. PHP and...

View Article


How Twitter Does MySQL - Get Their Fork

Twitter is a big proponent of knowledge sharing and open source software.  It's also well known that Twitter moved away from Casandra, and turned back towards relational databases, like MySQL.  But...

View Article

Mysql_fetch_all

Absurdly simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.<code>function mysql_fetch_all($result) { $all = array(); while ($all[] =...

View Article


Mysql_fetch_all

Absurdly simple but utilitarian function returns a numeric array of associative arrays containing an entire result set.<code>function mysql_fetch_all($result) { $all = array(); while ($all[] =...

View Article

Managing Cloud from the Command Line and Other Useful Links

Summer is here! Well, it is in most places. Here in the Pacific Northwest, we’re still waiting. Not to fear…we’ve got good reading weather! Here’s how we are keeping busy waiting for summer to arrive…...

View Article

Setting up PHP and MySQL on OS X 10.8 Mountain Lion

With OS X 10.8, Apple continues to ship PHP 5.3 with Xdebug, PEAR, GD and PDO_MYSQL. This is how to set it up from a clean install of 10.8. /usr/local Ensure that the following directories exist:...

View Article
Browsing all 35 articles
Browse latest View live