Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 18

Displaying posts with tag: open world (reset)

Adding dynamic fields to Signups on Drupal
+0 Vote Up -0Vote Down

In my day job at SkySQL I work with Drupal as our content management system.  One thing we often need to do is provide a way for people to sign up for events and the like.  One such event is the upcoming SkySQL and MariaDB: Solutions Day for the MySQL® Database and unlike other events we needed to take into account the dietary requirements of those wishing to attend.

For events registration we use the Signup module and use a theme template function to provide a set of standard fields.  The code looks something like this:

function ourtheme_signup_user_form($node) {
$form = array();
// If this function is providing any extra fields

  [Read more...]
See you at LCA2012
+1 Vote Up -0Vote Down

Linux.conf.au this year kicks off next week in Ballarat, just down the road from me.  I'll be there and even have a speaking gig, not in the main conference but in the HA and Distributed Storage mini-conf before the main event.

I'll be talking about MySQL®, the companies that now exist to support it, and the third party products that are starting to proliferate in what appears to be a community effort to address perceived shortcomings in the Oracle offerings.  Many of these offerings are in the HA space, and there have been some pretty amazing developments recently.

So if you want to find some history of

  [Read more...]
MySQL 101 - Replication
+1 Vote Up -0Vote Down

So far we've looked at many aspects of MySQL, not in any great depth, but hopefully with enough information to get you started and whet your appetite for more.  Now we start to look into areas that aren't in the basic tutorials.

Replication is the technology that allows data to be stored on multiple servers. Typically this is used in "scale out" applications.  "Scale out" is used in contrast to "Scale up" where to scale a solution you buy a bigger box to run it on, where "scale out" means you buy more boxes.  Each has its benefits and drawbacks, with the usual benefit of scale out being that you get more bang for your buck.

The way replication works in MySQL is pretty simple.  One server is identified as the master, and writes every transaction to a file, the binary log.  Other servers (and there may be many) act as slaves and

  [Read more...]
From MySQL to SkySQL - Reflections
+2 Vote Up -3Vote Down

This month marked SkySQL's first anniversary.  It also marks my 6 months with the company, after being with MySQL AB (and then Sun and finally Oracle) for over 5 years. As good a time as any for a look back and some musings of the future.

In late 2005 I took a position in the web team (a part of Marketing) at MySQL AB.  It was a great company to work for, with a great team of people and a truly great spirit.  The idea that they were making a difference every day was palpable. I then saw it taken over by Sun Microsystems and shortly after by Oracle Corporation.  We went from 500 employees to 30,000 and then to 100,000.  My job satisfaction started to decline.  I felt more like I was battling for every concession rather than revelling in what we were able to achieve.  I needed a

  [Read more...]
MySQL 101 - More Transactions
+0 Vote Up -0Vote Down

In our last episode we looked at transactions and how to create them.  In this episode I'll look at some of the implications of transactions, especially in a web application.

Transactions and Replication

We will discuss replication in depth later in the series, however it is sufficient for the moment to say that replication allows you to copy data in near real-time between MySQL servers and keep them synchronised.  What gets transferred are the changes that are made to your tables and data. So what about rolled-back (aborted) transactions?  Since the state after the rollback is essentially the same as the state before the transaction started, there seems little point in replicating those statements.  Indeed they are not replicated.

  [Read more...]
MySQL 101 - Transactions
+0 Vote Up -0Vote Down

We've now come a long way since our first steps at creating our online bookshop database. Now we need to start to think about how to sell the books and store details about the sales.  This is the time we need to start understanding database transactions.

Database transactions are very similar to real world transactions. They define a set of steps required to happen together in order for a transaction to be complete.  A real-world example might be that you buy a trinket from a store.  You find the trinket, then take it to the counter, find out the price, hand over the cash and receive your trinket.  That is a completed transaction.  Should you not have the available cash, the transaction would not be able to be completed and you would

  [Read more...]
MySQL 101 - Referential Integrity
+0 Vote Up -0Vote Down

In our last episode we learned how to modify data and table definitions.  This will come in handy as we look at building in referential integrity constraints into our database.  To begin we will need the database definition resulting from last episode's changes. You can download it here »

A word on Storage Engines

Before we can begin we need to understand a little about MySQL Storage Engines.  MySQL actually does only part of the job of parsing SQL, creating query plans, executing them and returning data sets.  Where the data is stored and retrieved there is a Storage Engine at work.  The original

  [Read more...]
MySQL 101 - Changing data and schema, UPDATE, ALTER
+0 Vote Up -0Vote Down

In our last episode we covered sorting, searching and grouping. We found out that using the COUNT(*) can be problematic when we have unexpected NULL data. Now we look at how to resolve data issues by updating the data, and perhaps even the table schema. We'll use the same database we did for the last episode. You can download it here ».

Updating Data

Let's recap.  If we pull the list of books, and authors, we find that "The Broken Shore" from Peter Temple has no price.  Not that it has a zero price, but it has a NULL value.

mysql> SELECT CONCAT_WS(' ',`author`.`first_name`,`author`.`last_name`) AS `author`,
 `book`.`title`, `book`.`price`
 FROM `author` INNER JOIN `book` ON

  [Read more...]
MySQL 101 - Sorting and Searching: ORDER BY, WHERE, GROUP BY
+1 Vote Up -0Vote Down

In our last episode we were able to select some information from our bookshop database, this time we look at putting this into some semblence of order.  To fully investigate this topic we need a few more entries in our database, so rather than detail them here, I've put together this SQL file you can download and build your database to follow along.

To install the database, unpack the SQL file from its ZIP archive, and use the SOURCE command to pull the data into your database:

SOURCE mysql101_bookshop_20110912.sql;

You can also pass the file to the mysql command line interpreter from the shell:

  [Read more...]
MySQL 101 - Retrieving data: SELECT and JOIN
+0 Vote Up -0Vote Down

In our last episode we started building up our online bookshop database, with tables for publishers, authors, formats and books.  At the moment we only have one book in there, so before we go too far, lets add a few more:

( NULL, 'The Big Score', 2, 4, 1, '2007-01-01', 9781741752236, 29.95 ),
( NULL, 'Split', 3, 2, 1, '2003-01-01', 0732268133, 29.95 );

So what is this NULL thing, and why have I used it?  If you remember we set the first field to an auto_increment id.  Because we don't want to supply a value for this, but let the database create the next value, we need to give a value that indicates we want this to happen.  For this instance, NULL is the value to

  [Read more...]
MySQL 101 - Creating your first database
+2 Vote Up -0Vote Down

In our last episode we found out how to connect to a MySQL server.  This time we learn how to lay out a database and start creating it. For this, and following episodes, we will be looking at creating a database to support an online bookshop.

Creating the database

Using the mysql command line client, you can connect to the server and then create the database.  We need a name for the database, and in this case we'll call it 'bookshop'.   We'll also create a user who is specifically allowed to add and update the database, but not alter its structure:

mysql> CREATE DATABASE `bookshop`;
Query OK, 1 row affected (0.01 sec)

mysql> GRANT INSERT, SELECT, UPDATE, DELETE ON `bookshop`.* to

  [Read more...]
MySQL 101 - Connecting to a MySQL server
+0 Vote Up -1Vote Down

In our last episode we looked at getting MySQL, today we will be looking at how you connect to a MySQL server and what that implies.

Connection basics

Before a client can connect to a MySQL server it needs a path by which that connection can be made. One method that is almost universal is the 'socket'.  As its name implies it is a way of plugging two (or more) applications together.  Sockets can either be end points for a network connection (for instance a TCP socket) or can use the same system-level functions but use a local connection.  This is sometimes called a UNIX socket, and relies on there being a special file that the two applications can use to initiate a connection.  MySQL can use both.

For a network connection you

  [Read more...]
MySQL 101 - Getting MySQL
+1 Vote Up -1Vote Down

This is the first in a series of posts on MySQL® for those new to the database, or those migrating from another DBMS.

So you've made the decision to try MySQL.  Now you just have to get it installed. Luckily for most purposes MySQL is quite often already available.  If you have a Linux installation then chances are that both the server and client are installed.  If you are planning on using MySQL for your website, chances are the hosting provider gives you several MySQL databases for your use.

Before diving in too deep though, let's get some background and terminology out of the way.

What is MySQL?

This depends.  MySQL was a company, is a trademark, is an ecosystem and is the name of arguably the most popular relational database management system (RDBMS) on the planet.  Originally developed by MySQL AB,

  [Read more...]
The First Day of the Rest of My Life
+6 Vote Up -0Vote Down

I always remember the saying that tomorrow is the first day of the rest of your life.  It refers to taking each day as it comes and making the best of it, and not concerning yourself with what you can no longer change - the past. This has new resonance for me today as tomorrow I start on a new job, as Webmaster for SkySQL Ab.

For the last five and a half years I've worked for MySQL in all its forms.  Initially MySQL AB, then the Database Group in Sun Microsystems, and finally the Open Source business unit in Oracle. (For anyone still at Oracle, forgive me if I get the names wrong, I don't think I ever fully worked out what our group's official name was).  For most of that time I've loved every minute of it, working with great people on a great product and bringing it to the world (or at least the World Wide Web

  [Read more...]
One down, one to go
+0 Vote Up -0Vote Down

The Memcached talk went down well and I was pleased that a number of people said how they could now understand how memcached could help them in their applications. This is really why I do these things - so that others can see the benefits of tools like memcached. It has worked well for us at MySQL.com and it obviously worked well for its originators at livejournal.

Original post blogged on b2evolution.

Memcached and MySQL.com
+0 Vote Up -0Vote Down

Seems like more secrets are being let out of the bag. MySQL Enterprise (http://www.mysql.com/products/enterprise/) provides support for Memcached (http://www.mysql.com/products/enterprise/memcached.html) - a distributed memory-based caching system, and I've been asked to present a webinar (http://www.mysql.com/news-and-events/web-seminars/display-253.html) discussing how we've used memcached in the MySQL.com architecture.

Once again it may come as a surprise that the MySQL.com websites have been using memcached well before MySQL started providing support. We were starting to have growing pains, with now 20 million page impressions and 3 million visitors per month, and needed to figure out how to effectively scale without throwing heaps of hardware at the problem. Memcached was a perfect solution and gives us a toolkit that is easily integrated into our

  [Read more...]
MySQL 5.1 - Pssst! The secret is out!
+0 Vote Up -0Vote Down

MySQL 5.1 went GA (Generally Available) recently. Can I let you in on a secret? Promise you won't tell anyone? The MySQL.com websites have been using 5.1 for 18 months now. It is a little known fact that quite often before even beta testers get hold of our software that little bunch of anarchists that is the web team get their grubby paws on it. But we aren't the only ones. In fact there were over 2 million downloads of 5.1 before it went GA. And 11 point releases.

Why do we do this? Well for one thing the web team is like any team of highly motivated, intelligent computer geeks and we love new toys. More than that we like to try and break them. But we are also responsible and don't like software that breaks and brings our websites down. It is a delicate balancing act, but one which we are committed to in order to
improve the product

  [Read more...]
Sheeri Cabral Speaks at Oracle Open World
+0 Vote Up -0Vote Down

An event truly fitting an “open world” — I will be speaking at Oracle Open World.

How does a wild-mannered MySQL DBA like me get to speak at an Oracle conference? Well, after I received the MySQL Community Award two years in a row, Dan Norris contacted me, and encouraged me to submit a proposal with him on how to contribute to the community.

Oracle has a formal program for recognizing community members at two levels: the Oracle ACE Director, and the Oracle ACE. An Oracle ACE Director is expected to make a 12-month commitment to working with the community, while an Oracle ACE is bestowed upon folks to recognize their volunteer efforts in the past. More information about the program can be found on

  [Read more...]
Showing entries 1 to 18

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.