Showing entries 25933 to 25942 of 44104
« 10 Newer Entries | 10 Older Entries »
Building PHP 5.3 packages on Ubuntu 9.04 (Jaunty) for Apache 2

Goal: Build a PHP 5.3 package, that I can install and upgrade on new ubuntu slices as needed, without having to compile on each box.

This is an amalgamation of different blog posts that did certain things really well, but not everything I wanted. The post I refer to specifically Installing PHP 5.3 on Ubuntu by Brandon Savage .

Prep your system

Setup your development server to be able to compile things. By default, most installations will not come with compilers installed.

apt-get install checkinstall

Say yes, and let it follow the dependencies as needed.

Get the development headers for some of the extensions you’ll be compiling in.


apt-get install postgresql-8.3 postgresql-client-8.3 postgresql-client-common postgresql-common postgresql-server-dev-8.3
aptitude install mysql-client …
[Read more]
Examples of bad queries

In my years of teaching MySQL topics, I've noticed that many people write bad queries. It's not necessarily their fault. It could be that they don't understand some aspect of SQL, or that they solved the problem with the first technique that came to mind, or that their query is fine except that MySQL optimizes it poorly. I'll give a few examples.

Correlated vs. Non-Correlated subquery
For those that don't know what a correlated subquery is: it means that the subquery relies on values from the outer query. If the subquery could be executed by itself, then it would be non-correlated. Here's an example of a non-correlated query. Using the `world` database, I want to return all cities that have a population larger than New York's population:

SELECT name FROM City WHERE population > (SELECT population FROM City WHERE name = 'new york');

Since the subquery can be run by itself, it's non-correlated. …

[Read more]
Sydney MySQL User Group meetup #9 — In-depth MySQL with Arjen Lentz

What: SMUG#9 – In-depth MySQL with Arjen Lentz

When: Monday, September 7, 2009 5:30 PM

Where: Please make sure to RSVP (even “Maybe”) so that we know how many are coming!
Sydney Mechanics School of Art
Level 3, 280 Pitt Street
Sydney
02 9262 7300

I’m very excited to announce a very special guest at this user group meeting!

Arjen Lentz is in town doing his Sydney training program 7-Sep to 9-Sep and kindly agreed to drop by and talk about something interesting in the MySQL world – …

[Read more]
Porting a web site from MS SQL to MySQL

My son is starting his senior year in High School, and he's doing an internship at Build-It-Yourself, a site for helping kids ages 8-13 design and build their own toys and robots. A section of the site, Build-It-Blocks, has a library of reusable, functional building blocks, construction tricks and presentation tips. In talking with my son, I learned that there's a desire to port Build-It-Blocks from MS SQL Server to MySQL. I offered to help out since I have some experience with MySQL from my work at Tokutek.

Several thousand person hours went into creating the existing site, so one of the goals is to re-use as much of the existing code and content as possible. Other goals include running on Windows, and minimizing the …

[Read more]
MySQL Labs

Who remembers snaps? This is the place to go, when you wanted nightly source code snapshots of stuff that comes out of MySQL AbSun Microsystems build systems, that is related to the MySQL product line. There you can get all the snapshots for GA releases, as well as archives; (albeit not very up-to-date).

Anyway, its good to know now there is a focus, just for server snapshots, available at MySQL Labs. These are testing builds, that come out directly from pushbuild (the build system). Its not for production use, but what’s really useful is the fact that there’s also a recommendation to use the …

[Read more]
Getting starting on the un-informed.org backend

A while back I blogged about helping out on the IT side of things or the un-informed.org project. A couple of people have replied and said they were interested in helping. In order to facilitate this, I have registered a project on google code and committed an initial version. Does not do much atm, but it features the current database schema concept and admin generator modules for the core entities. The step would be adding support for the various many to many relations. I hope I will have some time next week together with my co-worker Jordi to work on this. Check out the MySQL workbench schema file if you want to get a visual overview of the schema. …

[Read more]
mysql hostname prompt when host is localhost

I manage several mysql servers and often on these servers for security reasons the SUPER account is not allowed external network access, so access is made to localhost. When connecting to several hosts at the same time, for example from different ssh sessions, this can be inconvenient as the \h prompt only ever shows localhost and not the hostname of the server to which I’m connected.

The following small patch against 5.1.36 which can also be found here adds a new \H option which behaves the same as \h except in this case the hostname is shown.

diff --git a/Docs/mysql.info b/Docs/mysql.info
index 7747201..dffacfd 100644
--- a/Docs/mysql.info
+++ b/Docs/mysql.info
@@ -20512,6 +20512,8 @@ sequences.
 `\D'        The full current date
 `\d'        The default database
 `\h'        The server host
+`\H'        Same as `\h' except that if the server host is …
[Read more]
FrOSCon 2009: 1 down, 1 to go

So, I’m in my hotel room and I got some sleep. Now, it is 2:15 am and Icouldn’t sleep for some reason. PRobably has something to do with me being narcoleptic, as weird as it sounds Since I can’t sleep for a bit anyway, I figured writing a blog summarising the first day of FrOSCon would be a good idea.

Well, in one word: GREAT! In a few more: The first day was a big success. I started it out with a shift at the registration desk (I’m volunteering for FrOSCon as well). Since it was very early, most people that came in were actually exhibitors and speakers, and they all had to be at the VIP desk. At first, the door wouldn’t open. Later it turned out that the sensors thought we were to close to it. Claustrophobic doors are interesting.

Then, there was breakfast for the people with VIP access. Basically that was anyone who was not just a visitor. I helped out for a bit and then went back to my hotel room to catch up on some …

[Read more]
Talking to multiple databases with Symfony 1.2

Notes on using Symfony with multiple databases.

I’m building a new application in symfony, and I need to use some data from an existing application written by another developer.

I can’t just extend the existing application for reasons we don’t need to get into, but I do need to interface with the data, since the existing
app doesn’t really have a nice way to handle a SOA, or share data easily, my next best option is to talk to the original app’s db.

Things you need to think about.

  1. No Hacks This is not a hack, symfony/propel support this out of the box, the documentation mentions it briefly but it’s definitely possible.
  2. Permissions Should you share the same username/password? or different? In my case, I wanted to make sure symfony couldn’t write to the existing app, so I created a user with SELECT privileges only. (This will affect your ability …
[Read more]
Be careful with BETWEEN clauses, because the MySQL optimizer is not smarter than a fifth grader!

edit: I filed MySQL bug#46867 about this issue.

Ask anyone who has learned to count the following two questions. The answer to both of which should be yes.

Q:Is 5 between 1 and 10? A: Yes

Q:Is 5 between 10 and 1? A: Yes

Ask MySQL those same questions:

mysql>  (select 'Yes' 
           from dual 
          where 5 between 1 and 10
        ) 
        union 
        (select 'No'
        ) 
        limit 1;
+-----+
| Yes |
+-----+
| Yes |
+-----+
1 row in set (0.00 sec)

mysql>  (select 'Yes' 
          from dual 
         where 5 between 10 and 1 
        ) 
        union 
        (select 'No') 
        limit 1;
+-----+
| Yes |
+-----+
| No  |
+-----+
1 row in set (0.00 sec)



This is a problem because applications may produce BETWEEN clauses. I don't think most …

[Read more]
Showing entries 25933 to 25942 of 44104
« 10 Newer Entries | 10 Older Entries »