All Things Open to Zendcon next week

October 19, 2017

The week of the 23rd of October has two of my favorite shows and sadly, for me, they are at the same time on opposite sides of the country.

All Things Open has grown from a small show in Raleigh to a mega show with thousands of attendees.  It has an exciting and vibrant audience like the old OSCON shows had (but lost) and several tracks crammed with interesting sessions. This is a multi discipline show and there are always talks on new subjects that worth attending plus the latest on long time open source projects.  MySQL has sponsored this event since the beginning and continues this year.  Look for Andrew Rist in the MySQL booth.

I will be in Las Vegas for Zendcon and MySQL is also returning as a sponsor. This is a PHP centric show and has many sessions on the Zend Framework, other Rogue Wave products, and many PHP subjects. But is is just another PHP conference? No, it has a lot of heavy duty, in depth deep dives into what I would like to call industrial strength PHP development. This show has a lot of solid session for professional software developers. This is not he usual Vegas show with smoky passages and jarring slot machine noise and well worth the trip even if you are not a Viva Las Vegas type.

Advertisements

PNWPHP and Swanseacon

September 5, 2017

Busy month with PNWPHP at Washington University’s Kane Hall September 7th to the 9th. MySQL is sponsoring and I will be manning the booth. This is an exciting event on the PHP calendar and they have a great speaker lineup. Ticket are still available if you are in the area.

Swanseacon returns for a second year and I will be speaking on making MySQL Agile-ish. MySQL is proud to be sponsoring for a second year and I am looking forward to the wonderful Welsh audience again. Tickets are going quickly.

And do not forget that Oracle Open World is the first five days in October. MySQL will also have some post show events and I will provide more details when I get them.


Talks in April – Las Vegas, UK, TX, Santa Clara, and Oracle HQ!

March 28, 2017

April is going to be a busy month for yours truly. First up is the big Oracle Users Groups show in Las Vegas Collaborate 17 at Mandalay Bay April 2nd through 6th. This show features over 1,250 session, thousands of attendees and me (with Kathy Forte) at the MySQL Demo Pod.

From there I am off to Yorkshire PHP where I am proud to be speaking at this new event on MySQL 8. That is on Saturday the 8th in York but I will head down south on the 11th for the London MySQL Meetup to talk more about MySQL 8.

Then it is the closest show to home for me, the final LoneStar PHP. I will be giving a talk on the basics of database programming with PHP.

The month ends with Percona Live the 24th through the 27th and followed by Oracle Innovation Day on the 28th; the agenda for the FREE innovation day follows.

08:00 a.m. – 09:00 a.m.

Registration & Breakfast

09:00 a.m. – 09:15 a.m.

Welcome & Opening Remarks

09:15 a.m. – 10:00 a.m.

MySQL 8.0: What’s New

10:00 a.m. – 10:45 a.m.

MySQL 8.0: CTEs & Window Functions

10:45 a.m. – 11:00 a.m.

Morning Break

11:00 a.m. – 11:45 a.m.

MySQL in Oracle Public Cloud

11:45 a.m. – 12:30 p.m.

MySQL Enterprise Security

12:30 p.m. – 01:30 p.m.

Lunch

01:30 p.m. – 02:15 p.m.

MySQL Group Replication

02:15 p.m. – 03:00 p.m.

MySQL InnoDB Cluster

03:00 p.m. – 03:15 p.m.

Afternoon Break

03:15 p.m. – 04:00 p.m.

Best of Both Worlds | MySQL as a Document, Relation, and Combined Store

04:00 p.m. – 04:45 p.m.

MySQL Performance Tuning

04:45 p.m. – 05:00 p.m.

Wrap up


Four Conferences — All Things Open, Scotland PHP, & Buzzconf

October 31, 2016

Computer conferences each have their own personalities. Sure their are some common flavors — Utilikilts at Linux events for instance — but each have developed their own quirks. These character traits develop around the content of the show, the core beliefs of the organizers, and passion of the attendees who stride through the doors.

This past week All Things Open was held in Raleigh and Scotland PHP was held in Edinburgh. ATO has grown from four hundred attendees to twenty four hundred over four years. Scotland PHP was a first time event with about one hundred fifty or so present. Todd Lewis and the ATO crew have mastered providing great content at a very low cost at a show where offer a wide menu to many. Paul Dragoonis (to pick on one organizer) and his mainly Scots cohorts carefully studied other conferences to get just the right mix. Both had vibrant audiences who had direct and detailed questions about product, best practices, and implementation. Both made sure their attendees had exactly what information they needed on wifi, locations, supporting events, and schedule. And their venues were both amazing all though Scotland PHP was in the Dynamic Earth facility with a castle, Arthur’s seat, and a Parliament build very nearby that could have proven breathtaking distractions if the content of the show had not been so outstanding.

This week in New York is Container Days NYC where they have a mix of unconference, talks, workshops, and open spaces on putting software into containers. See you there!

Buzzconf is November 25th-27th in Australia (and sadly will be only show mentioned in this blog that I will not be able to attend) and has a wide content offering of virtual reality, Internet of Things (IoT), robots, machine learning, augmented reality, and space exploration (stuff out side the Earth’s atmosphere, not at all InnoDB related).

As a sponsor and/or speaker, you can tell a lot about the show by the quality and quantity of communications from the organizers. Those that sweat the details well beforehand tend to have a much more smoothly running event. MySQL has (or is) sponsoring all the above events and the forms to get into the Oracle purchase order system are very detailed. Then the purchase order itself must be accompanied with more documents. For small shows these bureaucratic tasks often chew up time and manpower, usually not on their PERT or GANTT charts. The above shows went throw this process with much more aplomb than I do. Hats off to all of them.

Final thought: If you attend a conference and had a good time, learned something, hated something else, or see something obviously wrong that nobody else has spotted– please tell the organizers and volunteers. They put on these events for you, the community. Believe me that they could easily go to bed early, make a few more kid’s sporting events, code a few more lines, or just have many more quiet minutes with the time they spend agonizing over details.

And the next time they have the urge to walk away they just might remember you and your saying ‘thank you’. Those two words have a lot of weight for only eight letters.


PHP and MySQL 5.7 JSON

February 11, 2016

I have been presenting on MySQL 5.7 and the new JSON data type to PHP Programmers at several shows and the one big request has been MORE EXAMPLES!!!!!!

Part of my presentation includes the big differences between PHP’s json_encode and the various MySQL supplied functions like JSON_ARRAY and JSON_OBJECT.  In my preliminary test I found the native PHP function did not always encode the information in a way that the MySQL server found palatable. The MySQL server wants properly valid JSON docs and unfortunately we have an impedance mismatch here.

Lets start with a simple associative array 
$alpha = array('a' => 1, 'b' => 2, 'c' => 3);  
and we want a JSON document that looks like 
{"a": 1, "b": 2, "c": 3}
 If we pass this array through json_encode (echo “json_encoded: ” . json_encode($alpha) . “\n”;)  we will end up with json_encoded: {“a”:1,”b”:2,”c”:3} which is not what is needed and the MySQL server will reject it with the ol’ ‘You have an error in your SQL syntax’ message.  Other php functions like serializeprint_r, and var_dump are pretty good with associative arrays but do not come close to providing the needed valid JSON.

THE JSON_HEX_QUOTE argument to json_encode changes the data to “a”, “1”, “b”, “2”, “c”, “3” }which is not any better. And it is a subtle change that seems, to me at least, to change keys and values to all keys, no values.

With no built in function, it is time to roll the array into a string formatted as desired.

$alphaz = "";
foreach ($alpha as $key => $value) {
                 $alphaz .= "'$key', $value, ";
}
$alphaz = substr($alphax,0,(strlen($alphaz) - 2)); 
/* Need to remove last ,\n */

This can be passed to the MySQL JSON_OBJECT function. Since it is valid JSON we can insert it into the database.

INSERT INTO foobar (mydata) VALUES (JSON_OBJECT('a', 1, 'b', 2, 'c', 3))

And in the database is the desired document.


mysql> select * from foobar;
+--------------------------+
| mydata |
+--------------------------+
| {"a": 1, "b": 2, "c": 3} |
+--------------------------+
1 row in set (0.00 sec)

mysql>

I will write more on this subject. Meanwhile feel free to try my little test program.

#!/usr/bin/php
 1, 'b' => 2, 'c' => 3);
echo var_dump($alpha);
echo "json_encoded: " . json_encode($alpha) . "\n";
echo "json_encoded HEX: " . json_encode($alpha,JSON_HEX_QUOT) . "\n";

$alphaz = "";
foreach ($alpha as $key => $value) {
        $alphaz .= "'$key', $value, ";
}
$alphaz = substr($alphaz,0,(strlen($alphaz) - 2)); /* strip last ,\n */
$query1 = "SELECT JSON_OBJECT($alphaz)";
echo "$query1\n";
if ($result = $mysqli->query($query1)) {
    $row = $result->fetch_row();
    printf("JSON is %s!\n", $row[0]);
} else {
        printf("Errormessage: %s\n", $mysqli->error);
        echo "FOO!!!!\n";
}
$query2 = "INSERT INTO foobar (mydata) VALUES (JSON_OBJECT($alphaz))";
echo "$query2\n";
if ($result = $mysqli->query($query2)) {
        echo "Inserted\n";
} else {
        printf("Errormessage: %s\n", $mysqli->error);
}
$query3 = "SELECT * FROM foobar";
if ($result = $mysqli->query($query3)) {
    $row = $result->fetch_row();
    printf("JSON is %s!\n", $row[0]);
} else {
        printf("Errormessage: %s\n", $mysqli->error);
}

$mysqli->close();
?>


Annual Holiday Shopping List

December 14, 2015

Database folks are a pain in the rear to shop for at holiday time. So print out a copy of this blog post, circle the items that you really like, and give this to someone who does the shopping for presents.

It is once again time for the MySQL holiday present list for that database person in your life. These quirky folks have unique tastes in presents and this list reflects this in abundance.

First item: Hello Kitty Screen Cleaner.

Hello Kitty Screen Cleaner available at many retailers near you and the perfect gift for those who spend long hours at their monitors.

Hello Kitty Screen Cleaner available at many retailers near you and the perfect gift for those who spend long hours at their monitors.

Everyone loves a clean screen and Hello Kitty Screen Cleaner is the second best thing to have a real cat complete with rough tongue to scrub your screen. Does Hello Kitty Screen Cleaner work better than say Thor Screen Cleaner? Doubtful but the bright pink and friendly face help remind your data nerd to keep things hygienic.

Second item: DBA Coffee Cup
DBA Coffee Cup

Third: Zazzle.com DBA t-shirts

Forth: Think Geek Coffee Cup

Fifth: And you can always buy tickets for the new Star Wars movie because, as you will be told, there is so much to see on the ‘tenth and twelfth’ viewing.

Any other suggestions? Please leave them in a comment.


Lucky Sevens — MySQL 5.7 and PHP 7

December 10, 2015

MySQL 5.7 and PHP 7 are the latest versions releases of two ofthe LAMP Stack pillars. In the past I have detailed how to use the MySQL apt-get repository to upgrade Ubuntu to the latest and greatest. But that about PHP 7? This is a fairly simple update for someone running a traditional LAMP (Linux Apache MySQL and PHP) server. There are also great directions out there on updating Nginx for those so inclined to be found with a quick search.

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get update
sudo apt-get purge php5-fpm
sudo apt-get install php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm php7.0-curl php7.0-gd php7.0-mysql
cp /usr/local/php7/libphp7.so /usr/lib/apache2/modules/

Then a quick test program:
<?php
$mysqli = new mysqli("localhost", "root", "hidave", "world");

/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}

/* print MySQL server version */
printf("

PHP version: %s

", phpversion());
printf("

MySQL version: %s

", $mysqli->server_info);
printf ("

System status: %s

", $mysqli->stat());

$mysqli->close();
?>

And the result:
PHP version: 7.0.0-5+deb.sury.org~vivid+1

MySQL version: 5.7.9

System status: Uptime: 2102 Threads: 1 Questions: 12 Slow queries: 0 Opens: 107 Flush tables: 1 Open tables: 26 Queries per second avg: 0.005

Please note that you will have to update your code if you use the old and no deprecated mysql calls instead of the supported mysqli calls.