tag:blogger.com,1999:blog-29593178058055420412024-03-29T00:35:00.682-07:00Chuck's BlogChuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.comBlogger33125tag:blogger.com,1999:blog-2959317805805542041.post-71822925953166197102018-06-28T18:40:00.001-07:002018-06-28T18:40:40.403-07:00MySQL 8.0 InnoDB Cluster on ARM64 with Oracle Linux and the Raspberry Pi 3BComing soon!<br />
<br />
This blog will present a tutorial on configuring MySQL 8.0 InnoDB Cluster running Oracle Enterprise Linux 7 for ARM64 on Raspberry Pi 3 computers.<br />
<br />
<br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com6tag:blogger.com,1999:blog-2959317805805542041.post-67565674206292718632016-08-05T09:46:00.002-07:002016-08-05T09:46:40.851-07:00Announcing: MySQL Utilities release-1.6.4 GAThe MySQL Utilities Team is pleased to announce a new GA release
of MySQL Utilities. This release includes a number of improvements for usability, stability, and a few enhancements for better compatibility with MySQL 5.7. A complete list of all
improvements can be found in our <a href="http://dev.mysql.com/doc/relnotes/mysql-utilities/en/index.html">release notes</a>.<br />
<br />
<h3>
Many Improvements!</h3>
<br />
This release represents a stable
release of the product and is a significant improvement from the 1.5 release. Along with defect patches, we also
include the following enhancements.<br />
<br />
<ul>
<li>Support for MySQL 5.7 </li>
<li>New! Binlog Utilities:</li>
<ul>
<li>mysqlbinlogpurge - purge old binary logs </li>
<li>mysqlbinlogrotate - rotate the binary log</li>
<li>mysqlbinlogmove - relocate binary log files </li>
</ul>
<li>New! Replication Utilities: </li>
<ul>
<li>mysqlslavetrx - skip transactions on one or more slaves to solve errant transactions and consistency error </li>
</ul>
<li>New! General Utilities: </li>
<ul>
<li>mysqlgrants - show grants for users</li>
</ul>
<li>Improved functionality of --exclude option with SQL wildcards </li>
<li>Improved packaging in RPM and Windows distributions </li>
<li>Improved accuracy of calculated disk usage for mysqldiskusage</li>
<li>Improved packaging in RPM and Windows distributions</li>
<li>Improved output for mysqldbcompare and mysqldiff </li>
<li>Improved SSL support</li>
<li>The Replication utilities have undergone a number of improvements for new 5.7 features as well as quality and usability improvements.</li>
<li>The documentation has been improved including more descriptions of SSL connections and clarification of replication commands. </li>
<li>Finally, this release contains a host of minor improvements for quality and robustness </li>
</ul>
<br />
<h3>
How Can I Download MySQL Utilities?</h3>
<br />
You can download
MySQL Utilities 1.6.4 GA from the following link using one of the
pre-built installation repositories including a source download. <br />
<br />
<a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a><br />
<br />
<h3>
Where is the Documentation?</h3>
<br />
You can find online documentation for MySQL Utilities version 1.6 at:<br />
<br />
<a href="http://dev.mysql.com/doc/index-utils-fabric.html">http://dev.mysql.com/doc/index-utils-fabric.html</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com7tag:blogger.com,1999:blog-2959317805805542041.post-72445763956938828212016-03-31T05:49:00.002-07:002016-03-31T05:49:30.629-07:00Announcing MySQL Utilities 1.6.3 Beta!The MySQL Utilities Team is pleased to announce a new beta release
of MySQL Utilities. This release includes a number of improvements for usability, stability, and a few enhancements. A complete list of all
improvements can be found in our <a href="http://dev.mysql.com/doc/relnotes/mysql-utilities/en/index.html">release notes</a>.<br />
<br />
<h3>
New Enhancements!</h3>
<br />
This release represents a stable
release of the product. Along with several defect patches, we also
include the following enhancements.<br />
<br />
Improved support for MySQL 5.7 <br />
Improved functionality of --exclude option with SQL wildcards<br />
Improved packaging in RPM and Windows distributions <br />
Improved accuracy of calculated disk usage for mysqldiskusage<br />
...and a host of minor improvements for quality and robustness <br />
<br />
<br /><h3>
How Can I Download MySQL Utilities?</h3>
<br />
You can download
MySQL Utilities 1.6.3 Beta from the following link using one of the
pre-built installation repositories including a source download. Click
on "Development Releases" to see the 1.6.3 release downloads.<br />
<br />
<a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a><br />
<br />
<h3>
Where is the Documentation?</h3>
<br />
You can find online documentation for MySQL Utilities version 1.6 at:<br />
<br />
<a href="http://dev.mysql.com/doc/index-utils-fabric.html">http://dev.mysql.com/doc/index-utils-fabric.html</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com20tag:blogger.com,1999:blog-2959317805805542041.post-70783692910990739262016-02-22T07:42:00.000-08:002016-02-22T07:42:16.621-08:00New book: MySQL for the Internet of ThingsAre you building an IOT solution and want to know how to store and retrieve your IOT data? Perhaps you're new to database systems and want to learn how to use them while you explore the exciting world of IOT.<br />
<br />
This book is the answer for both scenarios; whether you're new to IOT and want to know how to leverage MySQL in your solution or you've wanted to learn more about MySQL, this book will provide many of the answers you seek.<br />
<br />
The book also covers how to design your IOT solution around your data. Not only will you learn more about MySQL, but you will also see how best to deploy MySQL in your IOT solution using low-cost computer boards such as the Raspberry Pi, Beaglebone Black, Intel Galileo, and more.<br />
<br />
Finally, the book will give you a thorough overview of how data can be augmented and annotated to make it easier to glean the golden nuggets of knowledge you seek while wading through your sensor data.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDeeOeUrsS8rKZNeK9xiV-xIm6T85brOX_0LbI8euqcbuMusXDJFCyixFeZPFaytb2x-H5YEx57UhqoAVN_b6xjyWY9KjOHiPLg8kSzUJ10SKeuqusdDp5I_qN7gXaPnrPoSDNgqeVALw/s1600/9781484212943.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDeeOeUrsS8rKZNeK9xiV-xIm6T85brOX_0LbI8euqcbuMusXDJFCyixFeZPFaytb2x-H5YEx57UhqoAVN_b6xjyWY9KjOHiPLg8kSzUJ10SKeuqusdDp5I_qN7gXaPnrPoSDNgqeVALw/s320/9781484212943.jpg" width="224" /></a></div>
<br />
<br />
You can find my book at most online book sellers or directly from <a href="http://www.apress.com/9781484212943?gtmf=c" target="_blank">Apress</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHpwIW4fnrM9Xi7WH642q3AjbceghQmIeoOuPJpvaGq_4CMpYwFXwMrWt4QhJC2-Rd-JhYfA6XspfQq8ADvscKE3o3HmIvREGkxJ1SVCMuq0W-1Vlffm0zGtXS8gJkNgANIHTUFCy1bKw/s1600/ApressAuthorBadge.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHpwIW4fnrM9Xi7WH642q3AjbceghQmIeoOuPJpvaGq_4CMpYwFXwMrWt4QhJC2-Rd-JhYfA6XspfQq8ADvscKE3o3HmIvREGkxJ1SVCMuq0W-1Vlffm0zGtXS8gJkNgANIHTUFCy1bKw/s1600/ApressAuthorBadge.jpg" /></a></div>
<br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com28tag:blogger.com,1999:blog-2959317805805542041.post-29671941227672381002016-01-19T09:37:00.000-08:002016-05-16T05:55:09.436-07:00New Release! MySQL Connector/Arduino 1.1 The newest release of the MySQL Connector/Arduino library release-1.1 alpha is available for download. This new version represents a major step forward for the library in ease of use. Here are just a few of the important changes in this release.<br />
<br />
<ul>
<li><b><i>Added to Library Manager</i></b> : yes, you can download and install the library from the Arduino IDE now. Just open the Library Manager and search for "MySQL".</li>
<li><b><i>More Example Sketches</i></b> : there are many more example sketches of how to use the new library from basic connections to complex queries and more! </li>
<li><b><i>Redesigned Classes</i></b> : the library has been redesigned with new classes making it much easier to use a wider variety of shields and modules. Now, you pass in the <span style="font-family: "courier new" , "courier" , monospace;">Client</span> class for your shield and so long as it adheres to the <span style="font-family: "courier new" , "courier" , monospace;">Ethernet.Client </span>primitive, you can use any library to initiate the connector. No more <span style="font-family: "courier new" , "courier" , monospace;">#defines</span>!</li>
<li><b><i>Better Memory Management</i> </b>: the new classes permit you to manage memory easier by allocating the <span style="font-family: "courier new" , "courier" , monospace;">MySQL_Query</span> class dynamically leaving memory cleanup for the delete operation. No more <span style="font-family: "courier new" , "courier" , monospace;">free_*</span> methods!</li>
<li><b><i>It's on GitHub!</i> </b>: yes, the code is now on GitHub making it much easier to log and track issues. See <a href="https://github.com/ChuckBell/MySQL_Connector_Arduino">GitHub Repo</a>. </li>
</ul>
<br />
<h4>
Notes on Usage</h4>
<br />
If you have been using the previous versions of MySQL Connector/Arduino (1.0.4 and prior), do not despair as the old version remains in Launchpad and will be be left there for some time. Best of all, the new version does not cause conflicts with any of your existing sketches. That is, your existing sketches will not be affected by installing the new library.<br />
<br />
However, if you want to use the newest version in your existing sketches, you will have to change a few things. Please see the section entitled "<b><i>Changes from Previous Versions</i></b>" in the reference manual located in the extras folder of the library source code.<br />
<h3>
</h3>
<h3>
How do I get it?</h3>
<br />
As mentioned, you can simply open the Library manager in the Arduino IDE from the <b><i>Sketch->Include Library->Manage Libraries</i></b> menu. This opens the Library Manager. In the <i>filter your search</i> box, enter "MySQL" then choose the connector and click Install. In seconds, the new library is installed and ready for use. Cool, eh?<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWY6YRaFFUPGXarOGbbFDUMg-jtdei1yeUWgxNvXnyRtORSuJILhFBWS5qx5RlC1x-2WLGOPJMPMWpN2eoAgCUyzuIrYWVgb-MEtNqtB5hEjHSGMln2GkRTsAogXMhkeQ-kd6XF-0TRoQ/s1600/conn_ard.tiff" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWY6YRaFFUPGXarOGbbFDUMg-jtdei1yeUWgxNvXnyRtORSuJILhFBWS5qx5RlC1x-2WLGOPJMPMWpN2eoAgCUyzuIrYWVgb-MEtNqtB5hEjHSGMln2GkRTsAogXMhkeQ-kd6XF-0TRoQ/s640/conn_ard.tiff" width="640" /></a></div>
<br />
<br />
You can also check the Library Manager periodically for updates to this or any of the libraries you have installed.<br />
<br />
Of course, if you want to download the source code directly, you can find it on GitHub at <a href="https://github.com/ChuckBell/MySQL_Connector_Arduino">GitHub Repo</a>.<br />
<h3>
</h3>
<h3>
How do I use the library?</h3>
<br />
There is extensive documentation on how to use the library in the reference manual located in the extras folder. The document is named <span style="font-family: "courier new" , "courier" , monospace;">MySQL_Connector_Arduino_Reference_Manual.pdf</span>.<br />
<br />
<h3>
What if I have Questions?</h3>
<br />
You can post questions to this blog or if you find a defect, open an issue of GitHub. However, before you do either, please read the documentation - even if you've been using the older versions as much has changed!<br />
<br />
Enjoy!Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com56tag:blogger.com,1999:blog-2959317805805542041.post-20814156220569738622015-08-06T08:31:00.000-07:002015-08-06T08:31:13.119-07:003D Printing with Delta PrintersI am very pleased to announce my latest book, "3D Printing with Delta Printers" (Apress 2015). This book is focused entirely on delta printers including how to properly, build, configure, calibrate, use, and maintain your delta printer. The book is a companion to my "Building and Maintaining Your 3D Printer" (Apress 2014).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio5kPbKG_Y6E-fuQrkkxDHjuYXoTOXmhm_QVcRf2qNj7p9-c9CNVDmwtG8umTu5lDu9kp5eybZaq3tn2Te8eqGojRbTAfc5ZAPadzDxCxbotHsP8cwIUmm3kkpWZvS8Xpf9Z50Hgonw38/s1600/small.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEio5kPbKG_Y6E-fuQrkkxDHjuYXoTOXmhm_QVcRf2qNj7p9-c9CNVDmwtG8umTu5lDu9kp5eybZaq3tn2Te8eqGojRbTAfc5ZAPadzDxCxbotHsP8cwIUmm3kkpWZvS8Xpf9Z50Hgonw38/s320/small.jpg" width="224" /></a></div>
<br />
You can find both books in bookstores and online book retailers.<br />
<br />
Enjoy!Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com5tag:blogger.com,1999:blog-2959317805805542041.post-55010712562755024272015-07-29T08:57:00.000-07:002016-05-17T14:15:41.193-07:00New! MySQL Connector/Arduino release-1.0.4 GA and DocumentationAfter several iterations and a long period of community evaluation, I am happy to report I've released the newest, stable release of the MySQL Connector/Arduino. This library is designed to allow you to connect your Arduino via an Ethernet or WiFi shield to a MySQL database server running on your network (or the Internet!).<br />
<br />
<h3>
New Documentation!</h3>
Best of all, I've written a reference manual that includes examples of how to use the connector in a variety of ways. Included in the document are advice on how to write your sketches, troubleshooting tips, and a long FAQ compiled from the many questions from my blogs.<br />
<br />
<h3>
Changes </h3>
The only code change in this release is to fix a defect when using the connector with the latest versions of MySQL.<br />
<br />
<h3>
Downloading the Connector</h3>
To download the connector library and the new reference manual, visit <a href="https://launchpad.net/mysql-arduino">lp:mysql-arduino</a>.<br />
<br />
<h3>
For More Information</h3>
As a reminder, there is a forum for Q&A which can be found <a href="http://forums.mysql.com/list.php?175">here</a>. I try to check and respond to forum entries weekly.<br />
<br />
Happy Arduino!Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com46tag:blogger.com,1999:blog-2959317805805542041.post-76871576002529763052015-03-04T11:57:00.001-08:002015-03-04T11:57:27.984-08:00Announcing MySQL Utilities release-1.6.1 Alpha!The MySQL Utilities Team is pleased to announce a new alpha release of MySQL Utilities. This release includes a number of improvements for useabilty, stability, and a few enhancements. A complete list of all improvements can be found in our <a href="http://dev.mysql.com/doc/relnotes/mysql-utilities/en/index.html">release notes</a>.<br /><br />
<h3>
New Enhancements!</h3>
<br />This release represents a stable release of the product. Along with several defect patches, we also include the following enhancements.<br /><br />Improved support for MySQL 5.7 early releases <br />Improved output for mysqldbcompare <br />Improved SSL support <br /><br />
<h3>
New Utilities!</h3>
<br />This release also has three new utilities for you to try out:<br /><br />mysqlslavetrx - skip transactions on one or more slaves to solve errant transactions and consistency errors - <a href="http://dev.mysql.com/doc/mysql-utilities/1.6/en/mysqlslavetrx.html">docs</a><br />mysqlbinlogpurge - purge old binary logs - <a href="http://dev.mysql.com/doc/mysql-utilities/1.6/en/mysqlbinlogpurge.html">docs</a><br />mysqlbinlogrotate - rotate the binary logs - <a href="http://dev.mysql.com/doc/mysql-utilities/1.6/en/mysqlbinlogrotate.html">docs</a><br /><br />
<h3>
How Can I Download MySQL Utilities?</h3>
<br />You can download MySQL Utilities 1.6.1 Alpha from the following link using one of the pre-built installation repositories including a source download. Click on "Development Releases" to see the 1.6.1 release downloads.<br />
<br /><a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a><br /><br />
<h3>
Where is the Documentation?</h3>
<br />You can find online documentation for MySQL Utilities version 1.6 at:<br />
<br />
<a href="http://dev.mysql.com/doc/index-utils-fabric.html">http://dev.mysql.com/doc/index-utils-fabric.html</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com6tag:blogger.com,1999:blog-2959317805805542041.post-73095310153889892642015-03-04T11:50:00.000-08:002015-03-04T11:58:00.243-08:00Announcing MySQL Utilities release-1.5.4 GA!The MySQL Utilities Team is pleased to announce the general availability (GA) release of MySQL Utilities. This release includes a number of improvements for useabilty, stability, and a few enhancements. A complete list of all improvements can be found in our <a href="http://dev.mysql.com/doc/relnotes/mysql-utilities/en/index.html">release notes</a>.<br />
<br />
<h3>
New Enhancements!</h3>
<h3>
</h3>
This release represents a stable release of the product. Along with several defect patches, we also include the following enhancements.<br />
<br />
<ul>
<li>Improved support for MySQL 5.7 early releases</li>
<li>Improved output for mysqldbcompare</li>
<li>Improved SSL support </li>
</ul>
<br />
<h3>
How Can I Download MySQL Utilities?</h3>
<br />
You can download MySQL Utilities 1.5.2 GA from the following link using one of the pre-built installation repositories including a source download.<br />
<br />
<a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a><br />
<br />
<h3>
Where is the Documentation?</h3>
<br />
You can find online documentation for MySQL Utilities version 1.5 at:<br />
<br />
<a href="http://dev.mysql.com/doc/index-utils-fabric.html">http://dev.mysql.com/doc/index-utils-fabric.html</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com1tag:blogger.com,1999:blog-2959317805805542041.post-62895208567165415392015-03-04T07:36:00.000-08:002016-02-22T06:06:03.224-08:00New! Connector/Arduino release-1.0.3-rc is ready!<h3 class="post-title entry-title" itemprop="name">
</h3>
<div class="post-header">
</div>
I've completed a new release of the Connector/Arduino! The new release contains some minor improvements as follows.<br />
<br />
<ul>
<li>Code has been changed slightly to help with long latency issues over wifi and slow connections.</li>
<li>A new cleanup method was added to cleanup a final OK packet after a stored procedure call with a result.</li>
<li>Code now compiles without errors for the latest Beta Arduino IDE (const error).</li>
</ul>
<br />
<br />
Enjoy!Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com33tag:blogger.com,1999:blog-2959317805805542041.post-59596457650521078822014-09-28T15:00:00.002-07:002014-09-28T15:00:56.675-07:00Announcing MySQL Utilities release-1.5.2!The MySQL Utilities Team is pleased to announce the general availability (GA)
release of MySQL Utilities. This release includes a number of improvements for
useabilty, stability, and a few enhancements. A complete list of all
improvements can be found in our <a href="http://dev.mysql.com/doc/relnotes/mysql-utilities/en/wb-utils-news-1-5-2.html" title="release notes">release_notes</a>.
<br />
<h3>
New Enhancements!</h3>
This release represents a stable release of the product. Along with several defect patches, we also include the following enhancements.
<br />
<ul>
<li>The mysqlserverclone utility now checks diskspace as a prerequisite to cloning the server.</li>
<li>The --force option was removed from the mysqlfailover utility to remove confusion on its purpose.</li>
<li>A warning is issued if the mysqld --skip-innodb option is used because this option is ignored in MySQL 5.7 and later.</li>
<li>Utilities can correctly parse and display the PROXY privilege for GRANT statements.</li>
</ul>
<br />
<h3>
How Can I Download MySQL Utilities?</h3>
You can download MySQL Utilities 1.5.2 GA from the following link using one of the
pre-built installation repositories including a source download.
<a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a>
<br />
<h3>
Where is the Documentation?</h3>
You can find online documentation for MySQL Utilities version 1.5 at:
<a href="http://dev.mysql.com/doc/index-utils-fabric.html">http://dev.mysql.com/doc/index-utils-fabric.html</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com1tag:blogger.com,1999:blog-2959317805805542041.post-931147196540710432014-09-28T14:59:00.001-07:002014-09-28T14:59:39.443-07:00Announcing MySQL Utilities release-1.6.0-alphaThe MySQL Utilities Team is pleased to announce the alpha release of MySQL
Utilities. This release represents a new evolution of the product including the
following enhancements.
<br />
<ul>
<li>The mysqlprocgrep utility now displays the processes and connections killed
during a --kill operation. The displayed rows come from the appropriate SHOW
PROCESSLIST entries.</li>
<li>The mysqlbinlogmove utility was added. It relocates binary log files, and
moves files based on their sequence number or modified date.</li>
<li>The mysqlgrants utility was added. It displays grants per object, and
produces reports by user, user with grants, and GRANT statement.</li>
<li>Health reports can now be generated for a list of slaves without a master
specified. In this case, "No master specified" appears for connection status for
each slave, instead of an error.</li>
</ul>
<br />
<h3>
How Can I Download MySQL Utilities?</h3>
You can download MySQL Utilities 1.6.0 Alpha from the following link using one of the
pre-built installation repositories including a source download. Click on the Development Releases tab.
<a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com0tag:blogger.com,1999:blog-2959317805805542041.post-18769574638757526992014-09-28T14:57:00.001-07:002014-09-28T15:01:11.811-07:00Do you want to learn more about DevOps and MySQL?Are you attending Oracle Open World? Would you like to know more about Oracle DevOps products for managing your MySQL servers? If so, stop by Tuesday, September 30 at 10:15 in the Hotel Nikko - Bay View and join us for a hands on lab (HOL9234) for MySQL Utilities and Connector/Python.<br />
<br />
We will present the basics for getting started using Python to manage your MySQL servers. MySQL Utilities includes utilities for a wide variety of operations from displaying GRANT statements to setting up automatic failover for replication.<br />
<br />
Check out the abstract for the HOL <a data-mce-href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=9234" href="https://oracleus.activeevents.com/2014/connect/sessionDetail.ww?SESSION_ID=9234" title="here">here.</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com1tag:blogger.com,1999:blog-2959317805805542041.post-54216586397375849532014-09-04T14:09:00.000-07:002014-09-04T14:19:14.160-07:003D Printing Mastery Just Got a Little EasierMy new book on 3D printing has been published! I must say this work has been a real joy to write. It's the book I wish existed when I first started playing with 3D printers.<br />
<br />
Like most people who started with building their own 3D printer from scratch, I struggled to learn the concepts and get a firm foundation for how the machines work and how to work with them. I was dismayed by the lack of documentation and help available from most vendors. Indeed, most tend to say things like "do a Google search" rather than answer your questions directly.<br />
<br />
Fortunately, there is a lot of information out there about 3D printing, especially from the RepRap community. Unfortunately, the sheer volume can be overwhelming for most and in some cases the information is either not entirely correct or is too specific for a certain printer to be a solution you can use. Furthermore, it can take hours to sift through the data to find what you need and even more time to separate fact from fiction.<br />
<br />
I've already been through that and spent years sifting through the data. I have condensed everything I've learned into a medium-sized book that I think you will find to be the missing link from opening the box and setting up your printer for the first time to printing quality prints with confidence.<br />
<br />
I cover topics ranging from how to calibrate your printer to troubleshooting hardware, software, and even printing problems. While it won't make you a master of your 3D printer overnight, it will take you a lot further along in a short amount of time!<br />
<br />
Check it out: http://www.apress.com/9781430268093<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil439USiIa0B6NVWrKNl3HKOF5Ta-bkBXcMyBdnUZsBsf0Ypm_17DBYlCSOTyQa3wrwm7NDhZEhJno0OPxCe6mlzNvdgF_TE78U91hqLCx1IFfB9C8WqtWi9lRcYZo0nwJnSEk5RSBhcU/s1600/cover.tiff" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil439USiIa0B6NVWrKNl3HKOF5Ta-bkBXcMyBdnUZsBsf0Ypm_17DBYlCSOTyQa3wrwm7NDhZEhJno0OPxCe6mlzNvdgF_TE78U91hqLCx1IFfB9C8WqtWi9lRcYZo0nwJnSEk5RSBhcU/s1600/cover.tiff" /></a></div>
<br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com3tag:blogger.com,1999:blog-2959317805805542041.post-43373337053514287222014-04-03T06:53:00.000-07:002014-04-03T06:53:38.540-07:00New! MySQL Utilities release-1.4.2-RCThe MySQL Utilities Team is pleased to announce the latest release candidate (RC) release of MySQL Utilities. This release includes a number of improvements for useabilty, stability, and a few enhancements. A complete list of all improvements can be found in our <a href="http://dev.mysql.com/doc/relnotes/mysql-utilities/en/wb-utils-news-1-4-2.html">release_notes</a>.<br />
<br />
<h3>
New Utilities!</h3>
<br />
We have also included two new utilities.<br />
<ul>
<li>The mysqlrplsync utility was added, which checks data consistency between servers in a replicated setup. </li>
<li>The mysqlrplms utility was added, which provides round-robin multi-source replication (a slave server continually cycles through multiple masters in order to store a consolidated data set).
</li>
</ul>
<br />
<h3>
How Can I Download MySQL Utilities?</h3>
<br />You can download MySQL Utilities 1.4.2 from the following link using one of the pre-built installation repositories including a source download. Click on the Development Releases tab.<br />
<br /><a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a><br /><br />
<h3>
Where is the Documentation?</h3>
<br />You can find online documentation for MySQL Utilities version 1.4 at:<br /><br /><a href="http://dev.mysql.com/doc/index-gui.html">http://dev.mysql.com/doc/index-gui.html</a><br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com2tag:blogger.com,1999:blog-2959317805805542041.post-36986643508321447322014-04-02T10:28:00.000-07:002015-12-01T11:02:08.243-08:00Announcing MySQL Connector/Arduino 1.0.2 BetaI've completed a new release of the Connector/Arduino! The new release contains some major improvements with memory handling.<br />
<ul>
<li>The library has been trimmed to save memory.</li>
<ul>
<li>Static strings moved to PROGMEM strings</li>
<li>Unused structures removed (e.g. ok_packet)</li>
<li>Moved two more methods to optional compilation</li>
</ul>
<li>The WITH_SELECT is turned *OFF* by default. If you want to use select queries, be sure to uncomment this in the mysql.h file.</li>
<li>Added a CHANGES.txt file to track changes between releases.</li>
</ul>
<br />
<h3>
Memory, What Memory?</h3>
<br />
If you have used previous versions of the connector in medium to large sketches or have long query strings or even many variables, chances are you have hit the memory limit for your wee Arduino board.<br />
<br />
This can manifest itself in a number of ways. Most notably, the sketch may work for you until you add more code or more sensors in which it can fail to connect to the server. It can also exhibit random reboots or random freezes. If this is happening to you, it is most likely a memory issue.<br />
<br />
That is, the old version of the connector consumed nearly 70% of available dynamic memory - the memory used for variables. When the Arduino exceeds its memory limit, sketches will exhibit strange behavior or the board may reboot.<br />
<br />
Many people have encountered this so I've worked hard to try and squeeze more memory out of the connector. Which isn't easy considering it must keep a buffer of the data being sent to (or received from) the server.<br />
<br />
Let's see an example. The old version of the connector (1.0.1b), when compiled with the hello_mysql example for a Uno, consumes about 68% of available dynamic memory leaving only 637 bytes for your own variables. That's fine for a simple sketch but if you want to do complex queries building INSERT statements from several sensors or including other libraries for additional features (like an LCD), you're not going to be happy.<br />
<br />
While you can (and should) limit your memory use and even make use of PROGMEM for your static strings (and calling cmd_query_P()), it still isn't enough free memory for larger sketches. The <span style="font-size: small;">following is the compile message generated by the beta release of the Arduino IDE (1.5.4).<br /><br /><span style="font-family: "courier new" , "courier" , monospace;">Sketch uses 22,376 bytes (69%) of program storage space. Maximum is 32,256 bytes.<br />Global variables use 1,411 bytes (68%) of dynamic memory, leaving 637 bytes for local variables. Maximum is 2,048 bytes.</span><br /> </span><br />
<span style="font-size: small;">Now, with the new version of the library and SELECT turned on, the connector consumes only 58% of dynamic memory as shown below. While that is better, it isn't quite where we need to be.<br /><br /><span style="font-family: "courier new" , "courier" , monospace;">Sketch uses 22,152 bytes (68%) of program storage space. Maximum is 32,256 bytes.<br />Global variables use 1,197 bytes (58%) of dynamic memory, leaving 851 bytes for local variables. Maximum is 2,048 bytes.</span><br /> </span><br />
<span style="font-size: small;">If we turn off the SELECT feature with the new version, we get a little better.<br /><span style="font-family: "courier new" , "courier" , monospace;"><br />Sketch uses 20,736 bytes (64%) of program storage space. Maximum is 32,256 bytes.<br />Global variables use 1,064 bytes (51%) of dynamic memory, leaving 984 bytes for local variables. Maximum is 2,048 bytes.</span><br /> </span><br />
<span style="font-size: small;">Ah, now we're cooking. The dynamic memory usage is down to 51%. Much better.</span><br />
<span style="font-size: small;"><br /></span>
<br />
<h3>
Choosing the Right Board</h3>
<br />
One of the things users new to the connector have struggled with is choosing the right Arduino board for their project. The connector is a non-trivial library that consumes (relatively) a lot of memory. If you want to write a really big sketch using lots of variables, strings, etc., you will need to use a board with more memory.<br />
<br />
This is especially true when you combine the connector with other libraries like those made for some sensors, shields, and more. The combined memory for the connector and the other libraries can consume a lot of dynamic memory leaving you very little to use for your own variables.<br />
<br />
While most solve the problem by switching to a Mega board, that has its own issues because some of the pins differ from the smaller (memory-wise, not size-wise) boards. A few Google searches will quickly find solutions to these problems (hint: software serial).<br />
<br />
So which board should you choose? I've done some research for you and have compiled a simple MySQL sketch using the new version of the connector on a variety of boards. The following lists the memory usage reports from the Arduino Beta IDE. In this case, the compilations are with SELECT turned off (which is the new default).<br />
<br />
<ul>
<li>Duemilanove, Uno : 1,064 bytes (51%) of dynamic memory, leaving 984 bytes for local variables</li>
<li>Leonardo : 1,028 bytes (40%) of dynamic memory, leaving 1,532 bytes for local variables</li>
<li>Mega 2560 : 1,550 bytes (18%) of dynamic memory, leaving 6,642 bytes for local variables</li>
<li>Yun : 1,028 bytes (40%) of dynamic memory, leaving 1,532 bytes for local variables</li>
</ul>
<br />
As you can see, using the older Uno-style boards are going to limit your ability to write complex sketches with many variables, logic, etc. However, a Leonardo or even a Yun board may be a better choice especially if you run out of memory on the Uno-style board. Of course, the Mega is the best choice if your sketch is going to be very complex or if you need to store a lot of values in memory or use other, large libraries.<br />
<br />
<h3>
Conclusion</h3>
<br />
I hope this new version solves many of your problems with memory. I've tried to shrink it down as much as I can without radical changes. I believe the majority of the connection failures and freezes will be solved with this new version. Please feel free to provide feedback on this blog or (better) on the Oracle Connector/Arduino forum.<br />
<br />
<a href="http://forums.mysql.com/list.php?175">http://forums.mysql.com/list.php?175</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com18tag:blogger.com,1999:blog-2959317805805542041.post-8719222606005358362014-02-04T13:36:00.000-08:002015-12-01T11:01:50.348-08:00Announcing MySQL Connector/Arduino 1.0.1 BetaI've completed a new release of the Connector/Arduino. The new version supports a few refinements and a new feature.<br />
<br />
<ul>
<li>New! disconnect() method - enables disconnect from server. Note: you must call mysql_connect() to reconnect.</li>
<li>Better error handling for dropped packets. No more random reboots when bad packet appears.</li>
<li>Library can recover from short-term loss of connectivity. Along with bad packets is a check to make sure what is received is valid making the connector ignore garbage packets associated with a dropped connection.</li>
<li>Detection of Out of Memory condition. Should there not be enough memory to allocate the buffer for the Connector, you will see an OOM error (enable the serial monitor to see the errors). This reduces random reboots when memory gets too low.</li>
</ul>
I made this release because a number of people were running into problems with noisy, tenuous, or just plain bad network connections. Also, some do not want to hold the connection open on the database server. This release addresses all of these issues.<br />
<br />
<h3>
Did you say disconnect?</h3>
<br />
Yes, that's right, you can now disconnect from the server should you want to write sketches that connect to the MySQL server for only a brief period then sleep, calculate the distance to Alpha-centuri, make coffee, etc. It is also helpful for those sketches that will update the database only once every few minutes, hours, or days permitting you to connect, run a query, then disconnect on the interval.<br />
<br />
<h4>
But wait...what about when the Ethernet shield goes wonky?</h4>
<br />
I have also devised a way to overcome the problem of the Ethernet shield controller going away. That is, if your Arduino looses connectivity for more than a few seconds (about 15-30), the Ethernet shield could wig out and fail to respond. The rest of your sketch will continue to run but calls to the Ethernet library will be ignored (how rude).<br />
<br />
So...what to do? In short, we need to reboot the Ethernet shield. You could make a hardware-based connection to the reset button but some have reported problems with this solution. And it is a hard reset for the Arduino too - they are inseparable.<br />
<br />
Rather than use hardware, I've devised a way to force the Arduino to reload its software. This won't fix any hardware issues like the reset button will but it will restore the Ethernet shield to proper operation.<br />
<br />
<h4>
Ok, I'm sold. How do I do it?</h4>
<br />
First, you need a variable and a define to set a threshold.<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">int num_fails;<br />#define MAX_FAILED_CONNECTS 5</span></span><br />
<br />
Next, you need a method that will force the Arduino to reload. In this case, I use the tricky jump-to-zero address code which is sort of like a bootstrap (but not quite). Anyway, it works!<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">void soft_reset() {<br /> asm volatile("jmp 0");<br />}</span></span><br />
<br />
To use this in your sketch, modify the loop() method (or where ever you put your MySQL connector code) as follows:<br />
<br />
Note: this assumes your initial mysql_connect() call is in setup() like I originally intended. Modify the following accordingly if that is not the case.<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: x-small;">void loop() {<br /> delay(1000);<br /> if (my_conn.is_connected()) {<br /> my_conn.cmd_query(QUERY_SQL); // <-- br="" goes="" here="" query="" your=""> delay(1000);<br /> num_fails = 0;<br /> } else {<br /> my_conn.disconnect();<br /> Serial.println("Connecting...");<br /> if (my_conn.mysql_connect(server_addr, 3306, user, password)) {<br /> delay(500);<br /> Serial.println("Success!");<br /> num_fails = 0;<br /> } else {<br /> num_fails++;<br /> Serial.println("Connect failed!");<br /> if (num_fails == MAX_FAILED_CONNECTS) {<br /> Serial.println("Ok, that's it. I'm outta here. Rebooting...");<br /> delay(2000);<br /> soft_reset();<br /> }<br /> }<br /> }<br />}<!------><!------></--></span></span><br />
<br />
Notice the counter num_fails is incremented any time the connection to the MySQL server fails and is reset when it succeeds. If num_fails reaches the value of MAX_FAILED_CONNECTS, the sketch will call the soft_reset() method and the Arduino will be reloaded (not the same as restarting or resetting - keep that in mind if you use components that require a true reset to initialize).<br />
<br />
So now if your sketch runs happily for a time but looses its connection to the database server for a long period, it will reboot itself and therefore reestablish a connection - assuming the network or server is back up.<br />
<br />
Note: this code is in the hello_mysql_reboot sketch in the examples folder.<br />
<br />
Enjoy!Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com20tag:blogger.com,1999:blog-2959317805805542041.post-89077216001481603382013-12-19T14:18:00.001-08:002014-01-08T08:57:26.580-08:00New! MySQL Utilities release-1.3.6 GAThe MySQL Utilities Team is pleased to announce the latest GA release of MySQL Utilities. This release includes a number of improvements for usability, stability, and a few enhancements. We have also included a performance upgrade for exporting, importing, and copying databases.<br />
<br />
<h3>
Improvements</h3>
<br />
The following highlights a few of the more significant improvements.<br />
<br />
* mysqldbexport, mysqldbimport, and mysqldbcopy have multiprocessing support that allows for much improved performance<br />
* mysqlfrm can now generate a .frm file with storage engine substitution<br />
* Mac OS X packages added!<br />
* mysqlserverinfo now includes the log files (error, general, slow)<br />
* mysqlprocgrep can now search and kill processes by id<br />
* mysqlmetagrep can now search the body of routines with the new --body option<br />
* all utilities report license type with --version and --help<br />
* all utilities have the new --license option to view the license text<br />
* the mysqluc now reports errors with clearer text and tags the message with the name of the utility that returned the error<br />
* mysqlindexcheck now warns user if there is not enough information to calculate best/worst indexes<br />
* rpm, debian, and msi packages will update/remove old versions automatically when installing a newer version<br />
* the documentation is now a separate reference manual (see link below)<br />
<br />
The following spotlight some of the more important enhancements.<br />
<br />
<h3>
Multiprocessing with mysqldbexport, mysqldbimport, and mysqldbcopy</h3>
<br />
The performance of the mysqldbcopy, mysqldbexport and mysqldbimport utilities has been significantly improved. Moreover, a new --multiprocess option was added to allow concurrent execution making the most of the available CPU resources (the number of CPU cores).<br />
<br />
Note: the --thread option in mysqldbcopy was replaced by the --multiprocess option.<br />
<br />
Multiprocessing is applied at different levels according to the operating system. The utilities mysqldbcopy and mysqldbexport allow multiprocessing at the table-level for non-Windows systems and at the database-level for Windows system. The mysqldbimport utility allows multiprocessing at the file-level independently from the OS.<br />
<br />
Other more specific options were also added for performance reasons for the other utility. A new --output-file option was added to mysqldbexport to specify a file to store the generated output which allows faster output than sending messages to the terminal.<br />
<br />
Two additional additional options are now available in mysqldbimport: 1) --autocommit to enable autocommit for each operation because now by default a single commit is performed at the end of importing each file which is much faster, and 2) --max-bulk-insert to adjust the maximum number of inserts in a bulk, following the improved bulk insert support that is now provided.<br />
<br />
<h3>
Create New .frm Files with New Storage Engine</h3>
<br />
The mysqlfrm utility allows you to use the --new-storage-engine and the new --frmdir option to provide a directory to store the new .frm files. This feature is useful for those who want to recover the CREATE statement from existing .frm files and change the storage engine without having to launch the server. Try it out!<br />
<br />
<h3>
Mac OS X Installer</h3>
<br />
Yes, we now have a Mac OS X package installer. If you install Utilities with this installer, you will need to either use Connector/Python version 1.1.4 or later (which has a Mac OS X installer too) or use the Connector/Python 1.0.8 or later source code package and install manually.<br />
<br />
<h3>
How Can I Download MySQL Utilities?</h3>
<br />
You can download MySQL Utilities 1.3.6 from the following link using one of the pre-built installation repositories including a source download.<br />
<br />
<a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a><br />
<br />
If you are a commercial customer, you can download MySQL Utilities from the following link:<br />
<br />
<a href="http://dev.mysql.com/downloads/tools/utilities/">https://edelivery.oracle.com/</a><br />
<br />
MySQL Utilities is also available on Lauchpad as a source download at:<br />
<br />
<a href="https://code.launchpad.net/mysql-utilities">https://code.launchpad.net/mysql-utilities</a><br />
<br />
<h3>
Where is the Documentation?</h3>
<br />
You can find online documentation for MySQL Utilities version 1.3 at:<br />
<br />
<a href="http://dev.mysql.com/doc/index-gui.html">http://dev.mysql.com/doc/index-gui.html</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com4tag:blogger.com,1999:blog-2959317805805542041.post-55006766722146884272013-10-23T13:40:00.000-07:002015-12-01T11:01:10.298-08:00Introducing MySQL Connector/Arduino 1.0.0 betaThere is a new release of the Connector/Arduino on Launchpad! See https://launchpad.net/mysql-arduino. The new version supports a number of refinements and a few new features. These include:<br />
<ul>
<li>Improved support for processing result sets</li>
<li>Conditional compilation to omit result set handling features to save program space</li>
<li>Support for the Arduino WiFi shield</li>
<li>New version() method to check version of the connector</li>
<li>Simplified download (no more patching SHA1!)</li>
</ul>
<br />
<h4>
So What is It?</h4>
<br />
If you have never heard of Connector/Arduino, it is simply a library designed to allow the Arduino platform to connect to and issue queries to a MySQL Database server.<br />
<br />
Simply add an Ethernet shield to your Arduino and use the library to connect your Arduino to a MySQL database server. Yes, no more web-based hand waving or third party systems! Cool.<br />
<br />
<h3>
New Feature : Improved Support for Result Sets</h3>
<br />
In the previous version of the connector, there was a method named show_results() which demonstrated how to read result sets (rows returned from the server from a SHOW or SELECT query).<br />
<br />
Unfortunately, this method was too obtuse to be of any use to all but the most devoted connector fan (you had to know the source code really well). Perhaps worse, you had to modify the library directly to use the methods demonstrated.<br />
<br />
Why was it like that? Simply because I felt SELECT queries would be very rare and used by only a very small number of people. I was wrong. Live and learn, eh?<br />
<br />
The good news is the new version has additional methods that can be called from outside the library making it much, much easier to get results from your database. Let's see how to do this. <br />
<br />
<h3>
Example: Getting a Lookup Value</h3>
<br />
I think
the most popular request for supporting SELECT queries was to allow for
an easy way to query the database for a lookup value. Since lookup
queries are (or should be) designed to return exactly one row, we can
simplify the code as follows.<br />
<br />
Recall when the MySQL server returns a result set, the first thing returned is a list of the columns in the result set. Next are the rows. So we must process the columns first.<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;"> // SELECT query for lookup value (1 row returned)<br /> // Here we get a value from the database and use it.<br /> long head_count = 0;<br /> my_conn.cmd_query(QUERY_POP);<br /> // We ignore the columns but we have to read them to get that data out of the queue<br /> my_conn.get_columns();<br /> // Now we read the rows.<br /> row_values *row = NULL;<br /> do {<br /> row = my_conn.get_next_row();<br /> // We use the first value returned in the row - population of NYC!<br /> if (row != NULL) {<br /> head_count = atol(row->values[0]);<br /> }<br /> } while (row != NULL);<br /> // We're done with the buffers so Ok to clear them (and save precious memory).<br /> my_conn.free_columns_buffer();<br /> my_conn.free_row_buffer();<br /> // Now, let's do something with the data.<br /> Serial.print("NYC pop = ");<br /> Serial.println(head_count);</span></span><br />
<br />
In
this example, I query the database for the population of New York City
(nervemind the validity of that value), then use the value by printing
it out. Notice the basic structure is still there - read columns then
read rows but in this case we ignore the columns because we don't need
that data. We still need the free_*_buffer() calls to free memory
however. I explain these methods in the next example.<br />
<br />
<h3>
Example: Processing Result Sets </h3>
<br />
The next most popular request for supporting result queries was being able to loop through a result set and do something with the data. In this example, I create a method in my sketch to execute the query and process the results. Let's look at the code first.<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">/**<br /> * do_query - execute a query and display results<br /> *<br /> * This method demonstrates how to execute a query, get the column<br /> * names and print them, then read rows printing the values. It<br /> * is a mirror of the show_results() example in the connector class.<br /> *<br /> * You can use this method as a template for writing methods that<br /> * must iterate over rows from a SELECT and operate on the values read.<br /> *<br /> */<br />/*<br />void do_query(const char *q) {<br /> column_names *c; // pointer to column values<br /> row_values *r; // pointer to row values<br /><br /> // First, execute query. If it returns a value pointer,<br /> // we have a result set to process. If not, we exit.<br /> </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;"> if (!my_conn.cmd_query(q)) {<br /> return;<br /> }<br /><br /> // Next, we read the column names and display them.<br /> <br /> // NOTICE: You must *always* read the column names even if<br /> // you do not use them. This is so the connector can<br /> // read the data out of the buffer. Row data follows the<br /> // column data and thus must be read first.<br /> </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;"> c = my_conn.get_columns();<br /> for (int i = 0; i < c->num_fields; i++) {<br /> Serial.print(c->fields[i]->name);<br /> if (i < c->num_fields - 1) {<br /> Serial.print(",");<br /> }<br /> }<br /> Serial.println();<br /><br /> // Next, we use the get_next_row() iterator and read rows printing<br /> // the values returned until the get_next_row() returns NULL.<br /> </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;"> int num_cols = c->num_fields;<br /> int rows = 0;<br /> do {<br /> r = my_conn.get_next_row();<br /> if (r) {<br /> rows++;<br /> for (int i = 0; i < num_cols; i++) {<br /> Serial.print(r->values[i]);<br /> if (i < num_cols - 1) {<br /> Serial.print(", ");<br /> }<br /> }<br /> Serial.println();<br /> </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;"> // Note: we free the row read to free the memory allocated for it.<br /> // You should do this after you've processed the row.<br /> </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;"> my_conn.free_row_buffer();<br /> }<br /> } while (r);<br /> Serial.print(rows);<br /> Serial.println(" rows in result.");<br /><br /> // Finally, we are done so we free the column buffers<br /> </span></span><br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;"> my_conn.free_columns_buffer();<br />}</span></span><br />
<br />
So what's going on here? Notice how the code is structured to execute the query and if there are results (cmd_query() does not return NULL), we read the column headers. Why? Because the server always sends the column data back first for every result set.<br />
<br />
The return from the get_columns() method is a structure that contains an array of field structures. Here are the structures:<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">// Structure for retrieving a field (minimal implementation).<br />typedef struct {<br /> char *db;<br /> char *table;<br /> char *name;<br />} field_struct;<br /><br />// Structure for storing result set metadata.<br />typedef struct {<br /> int num_fields; // actual number of fields<br /> field_struct *fields[MAX_FIELDS];<br />} column_names;</span></span><br />
<br />
Notice the column_names structure has a fields array. Use that array to get information about each field in the form of the field_struct (see above) structure. In that structure, you will be able to get the database name, table name, and column name. Notice in the example I simply print out the column name and a comma after each except the last column.<br />
<br />
Next, we read the rows using a special iterator named get_next_row() which returns a pointer to a row structure that contains an array of the field values as follows:<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">// Structure for storing row data.<br />typedef struct {<br /> char *values[MAX_FIELDS];<br />} row_values;</span></span><br />
<br />
In this case, while get_next_row() returns a valid pointer (not NULL indicating a row has been read), we access each field and print out the values.<br />
<br />
You may be wondering what is MAX_FIELDS? Well, it is an easy way to make sure we limit our array to a maximum number of columns. This is defined in mysql.h and is set to 32. If you want to save a few bytes, you can change that value to something lower but beware: if you exceed that value, your code will wander off into la-la-land (via an unreferenced pointer). There is no end of array checking so tread lightly.<br />
<br />
Notice also there are calls to free_row_buffer() and free_columns_buffer(). These are memory cleanup methods needed to free any memory allocated when reading columns and row values (hey - we got to put it somewhere!).<br />
<br />
We call the free_row_buffer() <b>after</b> we are finished processing the row and the free_columns_buffer() at the end of the method. If you fail to add these to your own query handler method, you will run out of memory quickly.<br />
<br />
Why is it a manual process? Well, like the MAX_FIELDS setting, I wanted to keep it simple and therefore save as much space as possible. Automatic garbage collection would have added a significant amount of code. Likewise array bound checking would have add a bit more.<br />
<br />
You can use this method as a template to build your own custom query handler. For example, instead of printing the data to the serial monitor, you could display it in an LCD or perhaps use the information in another part of your sketch.<br />
<br />
<br />
<h3>
New Feature : Conditional Compilation</h3>
<br />
If you find you do not need the result set support, you can use conditional compilation to remove the methods and code from the connector. This can save you about 2k of program memory!<br />
<br />
To do this, simply edit the mysql.h file and comment out this code:<br />
<br />
<span style="font-size: x-small;"><span style="font-family: "courier new" , "courier" , monospace;">//#define WITH_SELECT // Comment out this for use without SELECT capability<br /> // to save space.</span></span><br />
<br />
This will tell the compiler to ignore key result set handling methods and code from the connector.<br />
<br />
If you do this but find there are methods suddenly missing (via compilation errors), check your sketch to make sure you are not using show_results(), get_columns(), get_next_row(), and similar methods. This is because with the SELECT code turned off, these methods no longer exist in the compiled library. Uncomment the #define WITH_SELECT to add them back.<br />
<br />
<h3>
New Feature : Support for WiFi Shield</h3>
<br />
To use the WiFi shield, you need only make a few changes to your sketch and a minor change to the library.<br />
<br />
<b>Note:</b>
You will need to download the WiFi library and install it to use the
WiFi shield. See http://arduino.cc/en/Main/ArduinoWiFiShield for more
information.<br />
<br />
First, add the #include for the WiFi library *before* the include for the connector (mysql.h).<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: x-small;">#include <WiFi.h> // Use this for WiFi<br />#include <mysql.h></span></span><br />
<br />
Next,
setup your choice of WiFi connection options in your setup() method.
While you're there, comment out the Ethernet.begin() call.<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: x-small;">// WiFi card example<br />char ssid[] = "my_lonely_ssid";<br />char pass[] = "horse_no_name";<br /><br />void setup() {<br /> Serial.begin(115200);<br /> while (!Serial); // wait for serial port to connect. Needed for Leonardo only<br /><br />// Ethernet.begin(mac_addr);<br /><br /> // WiFi section<br /> int status = WiFi.begin(ssid, pass);<br /> // if you're not connected, stop here:<br /> if ( status != WL_CONNECTED) {<br /> Serial.println("Couldn't get a wifi connection");<br /> while(true);<br /> }<br /> // if you are connected, print out info about the connection:<br /> else {<br /> Serial.println("Connected to network");<br /> IPAddress ip = WiFi.localIP();<br /> Serial.print("My IP address is: ");<br /> Serial.println(ip);<br /> }<br />...</span></span><br />
<br />
Lastly, you need to make one small change to the connector itself. Open the mysql.h file and uncomment these two lines:<br />
<span style="font-size: x-small;"><br /></span><span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: x-small;">#define WIFI // Uncomment out this for use with the WiFi shield<br />#include <WiFi.h> // Uncomment out this for use with the WiFi shield</span></span><br />
<br />
This tells the connector to use the conditional compilation sections to turn on support for the WiFi shield.<br />
<br />
<h3>
New Feature : version() method</h3>
<br />
I've added a method to return the version of the connector as a string. If you don't have this method, you're using an old version of the connector. As more releases of the connector occur, this method will be key in diagnosing problems or checking for support of certain features.<br />
<br />
<h3>
(Somewhat) New Feature : Single File Download</h3>
<br />
This was actually added to the Launchpad site for the previous version of the connector (version 1.0.0 alpha). But I'm making it the default download method from now on. You can still get the code the old way (by using bzr to clone the tree) but the single file download makes it much easier.<br />
<br />
Simply download the file, extract it, then place the two folders; mysql_connector and sha1 in your libraries folder then restart the IDE. Install done!<br />
<br />
I hope you enjoy the new enhancements.<br />
<br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com46tag:blogger.com,1999:blog-2959317805805542041.post-17278904350695052662013-10-22T19:17:00.001-07:002013-10-22T19:17:30.449-07:00Announcing: New Forum for Connector/Arduino!Due to the growing popularity of Connector/Arduino, the moderator of MySQL Forums has created a forum for us to meet up and discuss the connector. Yippie!<br /><br /><a href="http://forums.mysql.com/list.php?175">http://forums.mysql.com/list.php?175</a><br /><br />While the forum has been started very recently, I expect it will grow quickly as people discover the connector for the first time and experienced users find new and interesting ways to use it. I hope to moderate the new forum periodically to answer questions and respond to posts. See you there!<br /><br />Note: you need an account to write to the forum. Click on "register" in the upper right hand corner of the forum page to create an account if you do not already have one.<br /><br /><br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com0tag:blogger.com,1999:blog-2959317805805542041.post-47032490340964327662013-08-22T13:00:00.001-07:002013-08-22T13:00:16.631-07:00Announcing MySQL Utilities release-1.3.4 GAThe MySQL Utilities Team is pleased to announce the latest GA release of<br />MySQL Utilities. This release marks a milestone of concentrated effort to<br />expand the use of utilities in more diverse installations through improved<br />robustness, error handling, and quality.<br />
<br />
<h3>
</h3>
<h3>
Many Improvements</h3>
<br />
There are number such enhancements in this release. In this post we will<br />highlight a few of the more significant improvements.<br />
<ul>
<li>(new utility) MySQL .frm Reader (mysqlfrm) - read .frm files and generate CREATE statements with or without a server connection.</li>
<li>(revised) improved documentation including a section on example administrative tasks - see <a href="http://dev.mysql.com/doc/workbench/en/mysql-utilities.html">http://dev.mysql.com/doc/workbench/en/mysql-utilities.html</a></li>
<li>MySQL Utilities is packaged for .msi, .rpl, .deb platforms and source .tar/.zip</li>
<li>You can run mysqlfailover as a daemon on POSIX systems</li>
<li>Improved accuracy redundant index checking algorithm for mysqlindexcheck</li>
<li>Improved accuracy for comparing databases with mysqldbcompare</li>
<li>The --exclude option for mysqldbcopy and mysqldbexport now accept database patterns</li>
<li>Improved quoting of database, table, index names in SQL generation</li>
<li>External script return code checking for mysqlfailover, mysqlrpladmin</li>
<li>Slave thread state included in verbosity output of mysqlrplshow</li>
<li>The mysqldbimport utility can now read raw CSV files with headers</li>
</ul>
...and that's just a few of the many improvements in this release. While many<br />of these improvements have been filtering into the 1.2.X release over the last<br />year, this release marks the first GA in that time frame.<br />
<br />
<h3>
How Can I Download MySQL Utilities?</h3>
<br />
You can download MySQL Utilities 1.3.4 from<br /><a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a> using one of the pre-built<br />installation repositories including a source download. MySQL Utilities is also<br />available on Lauchpad as a source download at<br /><a href="https://code.launchpad.net/mysql-utilities">https://code.launchpad.net/mysql-utilities</a>.<br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com2tag:blogger.com,1999:blog-2959317805805542041.post-62396304633194622662013-04-06T15:50:00.000-07:002016-02-22T05:46:23.914-08:00Introducing MySQL Connector/Arduino<div class="_stretch">
Have you ever wanted to use a local database server to store data from
your Arduino projects? Would you like to be able to send queries directly to
a MySQL database from your Arduino sketch? Well, now you can!<br />
<br />
The MySQL Connector/Arduino is a new technology made for the Arduino permitting you to connect your Arduino project to a MySQL server via an Ethernet shield without
using an intermediate computer or a web-based service. </div>
<div class="_stretch">
<br /></div>
<div class="_stretch">
Having direct
access to a database server means you can store data acquired from your
project as well as check values stored in tables on the server and keep
the network local to your facility including having a network that isn't
connected to the internet or any other network.</div>
<div class="_stretch">
<br />
<h3>
Example Code</h3>
</div>
<div class="_stretch">
<br /></div>
<div class="_stretch">
The Connector/Arduino is an Arduino library that encapsulates everything
you need to communicate with a MySQL server. It's also very easy to
use. The following shows a simple sketch to connect to a MySQL server
and insert a row of data at startup.<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">/**<br />
* Example: Hello, MySQL!<br />
*<br />
* This code module demonstrates how to create a simple </span></div>
<div class="_stretch">
<span style="font-family: "courier new" , "courier" , monospace;">* database-enabled sketch.<br />
*/<br />
</span><span style="font-family: "courier new" , "courier" , monospace;">#include "SPI.h"<br />
#include "Ethernet.h"<br />
#include "sha1.h"<br />
#include "mysql.h"</span><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><spi .h=""><ethernet .h=""><sha1 .h=""><mysql .h="">/* Setup for Ethernet Library */<br />
byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };<br />
IPAddress server_addr(10, 0, 1, 23);<br />
<br />
/* Setup for the Connector/Arduino */<br />
Connector my_conn; // The Connector/Arduino reference<br />
<br />
char user[] = "root";<br />
char password[] = "secret";<br />
char INSERT_SQL[] = </mysql></sha1></ethernet></spi></span></div>
<div class="_stretch">
<span style="font-family: "courier new" , "courier" , monospace;"> "INSERT INTO test_arduino.hello VALUES ('Hello, MySQL!', NULL)";<br />
<br />
void setup() {<br /> Ethernet.begin(mac_addr);<br /> Serial.begin(115200);<br /> delay(1000);<br /> Serial.println("Connecting...");<br /> if (my_conn.mysql_connect(server_addr, 3306, user, password))<br /> {<br /> delay(500);<br />
/* Write Hello, World to MySQL table test_arduino.hello */<br />
my_conn.cmd_query(INSERT_SQL);<br />
Serial.println("Query Success!"); <br /> } <br /> else<br /> Serial.println("Connection failed.");<br />
}<br />
<br />
void loop() {<br />
}</span><br />
<br />
As you can see, the library adds very few methods for communicating with a MySQL server.<br />
<br />
<h3>
What Can It Do?</h3>
</div>
<div class="_stretch">
<br /></div>
<div class="_stretch">
The Connector/Arduino library allows you to issue queries to the
database server in much the same manner as you would through the MySQL
client application. You can insert, delete, and update data, call
functions, create objects, etc. Issuing <span style="font-family: "courier new" , "courier" , monospace;">SELECT</span> queries are also possible
but they incur a bit more thought concerning memory management.<br />
<br />
When issuing SELECT queries, the query strings must fit into memory and
the largest row of a result set must also fit in memory. This is because
result sets are read one row at a time and the class uses an internal
buffer for building data packets to send to the server. The connector
reads one packet-at-a-time and since the Arduino has a limited data
size, the combined length of all fields must be less than available
memory. It is suggested long strings be stored in program memory using
<span style="font-family: "courier new" , "courier" , monospace;">PROGMEM</span> (see <span style="font-family: "courier new" , "courier" , monospace;">cmd_query_P</span> in the <span style="font-family: "courier new" , "courier" , monospace;">mysql.cpp</span> file <a href="http://bazaar.launchpad.net/~chuck-bell/mysql-arduino/trunk/view/head:/mysql.cpp">http://bazaar.launchpad.net/~chuck-bell/mysql-arduino/trunk/view/head:/mysql.cpp</a>).<br />
<br />
Most projects are those that need to store data and in that case the
only memory requirements are those for the SQL statements. However, with
careful planning, you can preserve memory by using parametrized
queries.<br />
<br />
<h3>
Limitations</h3>
</div>
<div class="_stretch">
<br /></div>
<div class="_stretch">
As you can imagine, a library that communicates with a MySQL server is
larger than most libraries. Indeed, it consumes about 16-20k of program
space. Fortunately, the latest Arduino boards have enough memory that
only the most complex projects need be concerned. And in that case you
can move to a larger Arduino board like the Arduino Mega.<br />
<br />
Aside from memory, the following are some limitations you may want to consider when planning your sketches.<br />
<br />
<ul>
<li>
Query strings (the SQL statements) must fit into memory.</li>
<li>
Result sets are read one row-at-a-time and one field-at-a-time.</li>
<li>
The combined length of a row in a result set must fit into memory.</li>
<li>
Server error responses are processed immediately with the error code and text written via Serial.print.</li>
</ul>
<br />
<h3>
How To Get MySQL Connector/Arduino</h3>
<br /></div>
<div class="_stretch">
You can download Connector/Arduino from LaunchPad (<a href="https://launchpad.net/mysql-arduino">https://launchpad.net/mysql-arduino</a>).
The library is open source, licensed as GPLv2, and owned by Oracle
Corporation. Thus, any modifications to the library that you intend to
share must meet the GPLv2 license.<br />
<br />
By popular demand, I have made available a zip file that contains the mysql_connector and patched sha1 code. Go to https://launchpad.net/mysql-arduino and download the zip file, extract it, and copy the mysql_connector and sha1 folders to your Arduino/Libraries folder. <br />
<br />
<h3>
For More Information</h3>
<br /></div>
<div class="_stretch">
If you would like to get started using the library, please feel free to
download it and checkout the example and the text files for specifics of
installation and use.<br />
<br />
However, if you'd like a full tutorial and learn more about using the
Connector/Arduino in your project and to learn more about sensor
networks, look for my book entitled <i>Beginning Sensor Networks with
Arduino and Raspberry Pi</i> (Apress) due June 2013.</div>
<div class="_stretch">
<a href="http://www.blogger.com/goog_1977659400"><br /></a>
</div>
<div class="_stretch">
<a href="http://www.apress.com/">http://www.apress.com/</a></div>
<br />
<h4>
Note</h4>
<br />
The Connector/Arduino library was created to demonstrate the versatility of the
MySQL client protocol
and to provide a unique capability for the Arduino platform. While
offered under the GPLv2 license, the library is not supported by Oracle.
Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com396tag:blogger.com,1999:blog-2959317805805542041.post-51973110828469239072013-04-05T15:10:00.000-07:002013-04-08T06:49:29.727-07:00MySQL Utilities: The New .frm Reader UtilityHave you ever wondered what was in those .frm files littered throughout your data directory? Better still, have you encountered a situation where your data is either missing (was deleted) or damaged and all you have is the .frm files but don't know the structure of the table? Well, wonder no more!<br />
<br />
The MySQL Utilities Team is pleased to announce the newest utility - the .frm reader (mysqlfrm). This utility is designed to read .frm files and produce a facsimile of the <span style="font-family: "Courier New",Courier,monospace;">CREATE</span> statement for the table or view.<br />
<br />
<h3>
That's Impossible! How Can That Work?</h3>
<br />
It works by making a copy of the .frm file(s) and launching a new, read-only instance of your existing server. The server need not be running but you are required to provide an open port for the new instance with the --port option.<br />
<br />
The utility will launch the cloned server without reading your configuration file (<span style="font-family: "Courier New",Courier,monospace;">--no-defaults</span>). The utility also makes some minor modifications to the cloned server instance configuration to allow reading of the .frm file without data. Yes, that's right - you don't need your data files to use this utility!<br />
<br />
Using a new cloned instance and copying the .frm files means your original server is not altered in any way. The .frm reader also cleansup after itself by removing all temporary files and shutting down the cloned server.<br />
<br />
<h3>
Two Modes for Reading .frm Files</h3>
<br />
The .frm reader has two modes of operation. The default is intended for use in the normal process of discovering the <span style="font-family: "Courier New",Courier,monospace;">CREATE</span> statement in a .frm file. There is also a diagnostic mode for cases where the .frm file contains complex table settings or is damaged in some way.<br />
<br />
<h4>
Default Mode</h4>
<br />
The default mode, as described above, reads most .frm files and produces the <span style="font-family: "Courier New",Courier,monospace;">CREATE</span> statement for each. In this case, you need provide only the connection to the server via the <span style="font-family: "Courier New",Courier,monospace;">--server</span> option or the path to the server installation (for a downed server) with the <span style="font-family: "Courier New",Courier,monospace;">--basedir</span> option. You also need to provide a port with the --port option and, of course, a list of the .frm files you want to read or a list of directories to scan for .frm files.<br />
<br />
If you do not want to (or cannot) use an existing server to clone, you can use the <span style="font-family: "Courier New",Courier,monospace;">--diagnostic</span> mode instead.<br />
<br />
<h4>
Diagnostic Mode</h4>
<br />
The diagnostic mode reads the .frm files byte-by-byte and makes a best effort to read the data in the file. We say best effort because there are many nuances to the .frm file that have been introduced over the years. Suffice to say that without the servers code to assist, deciphering the data is non-trivial.<br />
<br />
We built the diagnostic mode as a feature to make it possible to get something useful from the files in the event the file is damaged or unreadable by the server or has complex table settings that the default mode cannot read or gives an error while reading. Thus, the <span style="font-family: "Courier New",Courier,monospace;">CREATE</span> statements produced in this mode may not be completely accurate and may be missing some parts. To get the most out of the diagnostic mode, provide a server connection to allow the reading of the character set information. This will improve the accuracy of column definitions.<br />
<br />
While this may sound like the diagnostic mode isn't as useful, remember that it is designed to be a tool for diagnosing problems (hence the name) rather than a duplication of the server code. If you think about it in that light, the diagnostic mode is a very important tool that you may need in certain situations where no other tool will work.<br />
<br />
While its accuracy is limited today, we plan to improve the feature in the future.<br />
<br />
<h3>
What's the Catch?</h3>
<br />
If you're thinking this is too good to be true, you're right - there are some limitations. Fortunately, these limitations are, er limited, for the default mode.<br />
<br />
The default mode currently cannot handle storage engines marked as <span style="font-family: "Courier New",Courier,monospace;">PARTITION</span> and PERFORMANCE_SCHEMA. Also, some elements of the table structure are not stored in the .frm file so these are not included in the CREATE statement. Again, fortunately this is a short list that currently includes foreign keys and autoincrement values.<br />
<br />
If you find the utility reporting it cannot read a .frm file in the default mode, try it again with the diagnostic mode.<br />
<br />
<h3>
Is That It?</h3>
<br />
The utility has a few features to help make it more versatile. For example, you can see the statistics for each file (dates, size, etc.) using the <span style="font-family: "Courier New",Courier,monospace;">--show-stats </span>option and you can substitute a new storage engine to be printed in the <span style="font-family: "Courier New",Courier,monospace;">CREATE</span> statement with the --new-storage-engine option (applies to all files read for each run of the utility).<br />
<br />
There is also a debug mode that prints more information. When used with the diagnostic mode, and you can see the actual values read from the file.<br />
<br />
<h3>
Skip the Hype and Show Me How it Works!</h3>
<br />
Suppose you find yourself in a situation where your server has gone wonky in such a way as to make your data inaccessible. Suppose that you do have access to your .frm files but no record of the latest changes to the schema. Now suppose you have a backup of the raw data. How do you know if the .frm files in your existing server match those in the backup? Simple: just run the .frm reader on your existing server .frm files then compare the results to your backup.<br />
<br />
But wait, what if the data directory is protected (your datadir is protected, isn't it)? Well, the .frm reader provides the --user option to allow you to launch the utility with elevated privileges to read the .frm files but execute the cloned server with a different user account.<br />
<br />
Observe the command:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">$ sudo env PYTHONPATH=$PYTHONPATH mysqlfrm --server=root:pass@localhost --port=3310 --user=mysql /usr/local/mysql/data/employees</span><br />
In this command, we clone the server with the mysql user account and tell the .frm reader to read all of the .frm files for the employees database.<br />
<br />
Here's the output.<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;"># Source on localhost: ... connected.<br /># Starting the spawned server on port 3310 ... done.<br /># Reading .frm files<br />#<br /># Reading the departments.frm file.<br />#<br /># CREATE statement for /usr/local/mysql/data/employees/departments.frm:<br />#<br /><br />CREATE TABLE `employees`.`departments` (<br /> `dept_no` char(4) NOT NULL,<br /> `dept_name` varchar(40) NOT NULL,<br /> PRIMARY KEY (`dept_no`),<br /> UNIQUE KEY `dept_name` (`dept_name`)<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1<br /><br />#<br /># Reading the dept_emp.frm file.<br />#<br /># CREATE statement for /usr/local/mysql/data/employees/dept_emp.frm:<br />#<br /><br />CREATE TABLE `employees`.`dept_emp` (<br /> `emp_no` int(11) NOT NULL,<br /> `dept_no` char(4) NOT NULL,<br /> `from_date` date NOT NULL,<br /> `to_date` date NOT NULL,<br /> PRIMARY KEY (`emp_no`,`dept_no`),<br /> KEY `emp_no` (`emp_no`),<br /> KEY `dept_no` (`dept_no`)<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1<br /><br />#<br /># Reading the dept_manager.frm file.<br />#<br /># CREATE statement for /usr/local/mysql/data/employees/dept_manager.frm:<br />#<br /><br />CREATE TABLE `employees`.`dept_manager` (<br /> `dept_no` char(4) NOT NULL,<br /> `emp_no` int(11) NOT NULL,<br /> `from_date` date NOT NULL,<br /> `to_date` date NOT NULL,<br /> PRIMARY KEY (`emp_no`,`dept_no`),<br /> KEY `emp_no` (`emp_no`),<br /> KEY `dept_no` (`dept_no`)<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1<br /><br />#<br /># Reading the employees.frm file.<br />#<br /># CREATE statement for /usr/local/mysql/data/employees/employees.frm:<br />#<br /><br />CREATE TABLE `employees`.`employees` (<br /> `emp_no` int(11) NOT NULL,<br /> `birth_date` date NOT NULL,<br /> `first_name` varchar(14) NOT NULL,<br /> `last_name` varchar(16) NOT NULL,<br /> `gender` enum('M','F') NOT NULL,<br /> `hire_date` date NOT NULL,<br /> PRIMARY KEY (`emp_no`)<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1<br /><br />#<br /># Reading the salaries.frm file.<br />#<br /># CREATE statement for /usr/local/mysql/data/employees/salaries.frm:<br />#<br /><br />CREATE TABLE `employees`.`salaries` (<br /> `emp_no` int(11) NOT NULL,<br /> `salary` int(11) NOT NULL,<br /> `from_date` date NOT NULL,<br /> `to_date` date NOT NULL,<br /> PRIMARY KEY (`emp_no`,`from_date`),<br /> KEY `emp_no` (`emp_no`)<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1<br /><br />#<br /># Reading the titles.frm file.<br />#<br /># CREATE statement for /usr/local/mysql/data/employees/titles.frm:<br />#<br /><br />CREATE TABLE `employees`.`titles` (<br /> `emp_no` int(11) NOT NULL,<br /> `title` varchar(50) NOT NULL,<br /> `from_date` date NOT NULL,<br /> `to_date` date DEFAULT NULL,<br /> PRIMARY KEY (`emp_no`,`title`,`from_date`),<br /> KEY `emp_no` (`emp_no`)<br />) ENGINE=InnoDB DEFAULT CHARSET=latin1<br /><br />#<br /># Reading the view1.frm file.<br />#<br /># CREATE statement for /usr/local/mysql/data/employees/view1.frm:<br />#<br /><br />CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `employees_temp`.`view1` AS select `employees`.`t1`.`a` AS `a` from `employees`.`t1`<br /><br />#...done.</span><br />
<br />
Is that cool or what? Notice it also reads .frm files for views. Very cool.<br />
<br />
<h3>
What About Diagnostic Mode?</h3>
<br />
Let's take one of the tables in the employees database and run it with the diagnostic mode. For fun, lets change the storage engine and show the file statistics. We specify the server (this is optional) so that if there are multiple byte character sets the diagnostic mode will correctly translate the field lengths. For example, if your table has a 3-byte character set and you do not provide a server connection, there is no way to know that a value of 30 read from the file is actually a field length of size 10 thus <span style="font-family: "Courier New",Courier,monospace;">char(10)</span> would appear char(30) without the server connection.<br />
<br />
Observe the command and output:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">$ sudo env PYTHONPATH=$PYTHONPATH mysqlfrm --server=root:pass@localhost --diagnostic --show-stats --new-storage-engine=MEMORY /usr/local/mysql/data/employees/titles.frm<br /># Source on localhost: ... connected.<br /># CAUTION: The diagnostic mode is a best-effort parse of the .frm file. As such, it may not identify all of the components of the table correctly. This is especially true for damaged files. It will also not read the default values for the columns and the resulting statement may not be syntactically correct.<br /># Reading .frm file for /usr/local/mysql/data/employees/titles.frm:<br /># The .frm file is a TABLE.<br /># CREATE TABLE Statement:<br /><br />CREATE TABLE `employees`.`titles` (<br /> `emp_no` int(11) NOT NULL,<br /> `title` varchar(50) COLLATE `latin1_swedish_ci` NOT NULL,<br /> `from_date` date NOT NULL,<br /> `to_date` date DEFAULT NULL,<br />PRIMARY KEY `PRIMARY` (`emp_no`,`title`,`from_date`),<br />KEY `emp_no` (`emp_no`)<br />) ENGINE=MEMORY DEFAULT CHARSET=latin1;<br /><br /># File Statistics:<br /># Last Modified : Thu Jan 26 14:23:14 2012<br /># Creation Time : Wed Jan 4 12:15:21 2012<br /># Last Accessed : Fri Mar 22 15:18:33 2013<br /># Mode : 33200<br /># Size : 8672<br /><br /># Table Statistics:<br /># Engine : INNODB<br /># frm Version : 10<br /># MySQL Version : 5.1.50<br /># frm File_Version : 5<br /># IO_SIZE : 4096<br /># Def Partition Engine : None<br /><br />#...done.</span><br />
<br />
Interesting, eh? If the disclaimer is scary, it is intended to be a reminder that the output may not be as accurate as the default mode. In this case, we see some very minor differences but none of which are showstoppers nor do they demure the usefulness of the output. Lastly, notice we did indeed change the storage engine.<br />
<br />
Notice also the file stats show the modification and creation date as well as the original storage engine and version of the server when the .frm file was created.<br />
<br />
<h3>
Ok, I'm Hooked! Where Can I Get It?</h3>
<br />
The .frm reader utility is part of the new release-1.3.0 Alpha available as a separate download at <a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a>. Simply choose the platform repository or source repository and download it.<br />
<br />
We welcome your comments and hope that this utility will help expand your diagnosis and recovery toolkit.<br />
<br />
<h3>
Postlude </h3>
<br />
Many thanks to Giuseppe Maxia for creating the surprisingly useful employees test database! You can download it from: <a href="https://launchpad.net/test-db/">https://launchpad.net/test-db/</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com4tag:blogger.com,1999:blog-2959317805805542041.post-33958166218513131902013-04-05T14:59:00.001-07:002013-04-05T14:59:37.345-07:00Introducing MySQL Utilities release-1.3.0The MySQL Utilities Team is pleased to announce a major advancement of MySQL Utilities. It is now available as a separate download!<br /><br />That's right. If you want to use MySQL Utilities without installing MySQL Workbench, you can do that now.<br /><br />The Utilities release-1.3.0 has been built for Windows Installer, RPM archive, and .tar/.zip. We have also made downloads for source only if you want to use Utilities to develop your own utilities or install the product in custom location. We plan to add other repositories in the future.<br /><br />Is that it? Well, not quite. We have also included a new utility - the .frm Reader. See the blog, "New Utility: .frm Reader" for more information.<br /><br />If you'd like to try out the new download, visit the MySQL Workbench download page:<br />
<br />
<a href="http://dev.mysql.com/downloads/tools/utilities/">http://dev.mysql.com/downloads/tools/utilities/</a><br /><br />
<b>Note</b>: this is an alpha release and will follow the alpha-beta-GA development path. As such, it is not included in MySQL Workbench. However, it does include all of the improvements from the release-1.2.X tree.<br /><br />For more information about switchover, failover, replication and MySQL high availability, download the "Guide to Building a Self-healing Replication Topology", which discusses how Global Transaction Identifiers and the MySQL replication utilities can be used for failover and switchover with slave promotion from:<br />
<br />
<a href="http://www.mysql.com/why-mysql/white-papers/mysql-replication-high-availability/">http://www.mysql.com/why-mysql/white-papers/mysql-replication-high-availability/</a>Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com0tag:blogger.com,1999:blog-2959317805805542041.post-63823689163284284262013-04-05T14:53:00.000-07:002013-04-05T14:53:49.876-07:00Introducing MySQL Utilities release-1.2.1The MySQL Utilities Team is pleased to announce our latest release, version 1.2.1. This release contains many quality improvements and enhancements to the HA and Replication utilities. The following lists some of the most significant improvements.<br />
<ul>
<li>Improved transaction gathering algorithm for failover</li>
<ul>
<li>Skips slaves that are already caught up</li>
<li>Ensures all transactions in the relay logs on the slaves are executed first</li>
</ul>
<li>External scripts in mysqlfailover and mysqlrpladmin now receive the old and new master information</li>
<li>Improved demote master handling for switchover</li>
<li>Improved connection error handling</li>
<li>Quoting of tables and database names has been improved</li>
<li>Login-path feature now reads port and socket</li>
</ul>
The utilities team continues to focus on improving usability, making features easier to use, and improving overall quality of error handling.<br /><br />You can try the new release by downloading it from LaunchPad at:<br /><br /><a href="https://launchpad.net/mysql-utilities">https://launchpad.net/mysql-utilities</a><br /><br />For more information about switchover, failover, replication and MySQL high availability, download the "Guide to Building a Self-healing Replication Topology", which discusses how Global Transaction Identifiers and the MySQL replication utilities can be used for failover and switchover with slave promotion from:<br />
<br />
<a href="http://www.mysql.com/why-mysql/white-papers/mysql-replication-high-availability/">http://www.mysql.com/why-mysql/white-papers/mysql-replication-high-availability/</a><br />
<b><br />Note:</b> this is an interim release. These features will be included in a future release of MySQL Workbench.<br />Chuckhttp://www.blogger.com/profile/02410977284521913938noreply@blogger.com0