<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:series="http://unfoldingneurons.com/"
><channel><title>Larry Ullman &#187; database</title> <atom:link href="http://www.larryullman.com/tag/database/feed/" rel="self" type="application/rss+xml" /><link>http://www.larryullman.com</link> <description>Translating Geek Into English</description> <lastBuildDate>Mon, 21 May 2012 11:03:07 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>WWW SQL Designer, an online database modeling tool</title><link>http://www.larryullman.com/2012/03/09/www-sql-designer-an-online-database-modeling-tool/</link> <comments>http://www.larryullman.com/2012/03/09/www-sql-designer-an-online-database-modeling-tool/#comments</comments> <pubDate>Fri, 09 Mar 2012 15:36:01 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[JavaScript]]></category> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[database]]></category> <category><![CDATA[design]]></category> <category><![CDATA[model]]></category> <category><![CDATA[schema]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=3147</guid> <description><![CDATA[Some time ago I stumbled upon the WWW SQL Designer, an online database modeling tool, created by Ondrej Zara. It&#8217;s built in JavaScript, and runs in the browser, although PHP is required for some functionality. You can download the code from its Google Code home page so that you can run it in from your own [...]]]></description> <content:encoded><![CDATA[<p>Some time ago I stumbled upon the <a
href="http://code.google.com/p/wwwsqldesigner/">WWW SQL Designer</a>, an online database modeling tool, created by <a
href="http://ondras.zarovi.cz/">Ondrej Zara</a>. It&#8217;s built in JavaScript, and runs in the browser, although PHP is required for some functionality. You can download the code from its Google Code home page so that you can run it in from your own computer, but to see a demo of it in action (a completely usable demo), head to <a
href="http://ondras.zarovi.cz/sql/demo/">http://ondras.zarovi.cz/sql/demo/</a>.</p><p>There&#8217;s not much in the way of documentation, but the tool is pretty straightforward, and there&#8217;s a <a
href="http://www.youtube.com/watch?v=hCQzJx9AKhU">YouTube video</a>, if you want. To start, just create a new table, giving it a name. The tool will automatically create the autoincremented primary key for each new table. Then you can add other columns and indexes (aka keys). Add more tables as needed, and you can easily indicate the relationships between tables by marking foreign keys. Once you&#8217;re done with the design, you can export the SQL. The tool supports many different databases, including MySQL, SQLite, Oracle, and PostgreSQL. The outputted SQL is also nicely broken down, separating, for example, the foreign key statements and table properties (e.g., the character set, collation, and storage engine) into standalone <strong>ALTER</strong> queries, allowing you to use whatever commands you need when you actually go to create the database in your database application. The generated SQL even provides demo <strong>INSERT</strong> statements for the tables. Alternatively, you can save the design as XML, allowing you to reload that design in the application for further editing at another time.</p><p>I&#8217;m always on the lookout for a good database design tool, so was pleased to find this one. It&#8217;s particularly useful when I&#8217;m not on my primary computer, such as when I&#8217;m at a client&#8217;s office, and need to whip up some SQL on the fly. Check it out for yourself and see what you think. The price—free—is right!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2012/03/09/www-sql-designer-an-online-database-modeling-tool/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Introduction to MongoDB</title><link>http://www.larryullman.com/2011/11/10/introduction-to-mongodb/</link> <comments>http://www.larryullman.com/2011/11/10/introduction-to-mongodb/#comments</comments> <pubDate>Fri, 11 Nov 2011 02:43:51 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[database]]></category> <category><![CDATA[mongodb]]></category> <category><![CDATA[non-relational]]></category> <category><![CDATA[nosql]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2862</guid> <description><![CDATA[phpmaster recently posted an article titled Introduction to MongoDB. I&#8217;m not entirely sold on non-relational databases yet, in that while I can see how wonderfully beneficial they can be in many situations, they&#8217;re not as ubiquitously useful as all the hype would seem to suggest. But in any case, a good article like this one, [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://phpmaster.com">phpmaster</a> recently posted an article titled <a
href="http://phpmaster.com/introduction-to-mongodb/">Introduction to MongoDB</a>. I&#8217;m not entirely sold on non-relational databases yet, in that while I can see how wonderfully beneficial they can be in many situations, they&#8217;re not as ubiquitously useful as all the hype would seem to suggest. But in any case, a good article like this one, which introduces <a
href="http://www.mongodb.org/">MongoDB</a>, shows how to install support for it in PHP (although the instructions are for Unix-like systems), and provides code for actually interacting with a MongoDB database is worth the time to read.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/11/10/introduction-to-mongodb/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>NoSQL Standouts</title><link>http://www.larryullman.com/2011/09/08/nosql-standouts/</link> <comments>http://www.larryullman.com/2011/09/08/nosql-standouts/#comments</comments> <pubDate>Thu, 08 Sep 2011 05:16:22 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[database]]></category> <category><![CDATA[nosql]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2790</guid> <description><![CDATA[InfoWorld just posted a good and long article discussing the particular strengths and weaknesses of various NoSQL (aka, non-relational) databases. If you&#8217;re intrigued about what NoSQL databases are all about, and maybe even thinking about starting to play around with one, it&#8217;s well worth your time to read. As for me personally, CouchDB and MongoDB [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://www.infoworld.com">InfoWorld</a> just posted a good and long article discussing the <a
href="http://www.infoworld.com/d/data-explosion/no-sql-new-databases-new-applications-400?source=IFWNLE_nlt_daily_2011-09-05">particular strengths and weaknesses of various NoSQL (aka, non-relational) databases</a>. If you&#8217;re intrigued about what NoSQL databases are all about, and maybe even thinking about starting to play around with one, it&#8217;s well worth your time to read.</p><p>As for me personally, CouchDB and MongoDB are still most attractive, in some part due to their use of JavaScript and JSON, and in part because of existing PHP libraries for interacting with these database applications.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/09/08/nosql-standouts/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>More on Non-relational (aka, NoSQL) Databases</title><link>http://www.larryullman.com/2011/07/29/more-on-non-relational-aka-nosql-databases/</link> <comments>http://www.larryullman.com/2011/07/29/more-on-non-relational-aka-nosql-databases/#comments</comments> <pubDate>Fri, 29 Jul 2011 20:52:06 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[database]]></category> <category><![CDATA[non-relational]]></category> <category><![CDATA[nosql]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2694</guid> <description><![CDATA[Non-relational databases seem to be getting all the attention these days (apparently we&#8217;ve moved on from HTML5). If you&#8217;re not familiar with the concept of a non-relational database, they are sometimes called NoSQL databases, but that&#8217;s a misnomer, as these databases do use SQL. What a non-relational database does not do is organize its data in [...]]]></description> <content:encoded><![CDATA[<p>Non-relational databases seem to be getting all the attention these days (apparently we&#8217;ve moved on from HTML5). If you&#8217;re not familiar with the concept of a non-relational database, they are sometimes called <em>NoSQL databases</em>, but that&#8217;s a misnomer, as these databases do use SQL. What a non-relational database <em>does not do</em> is organize its data in related tables (i.e., data is stored in a non-normalized way). For example, in a conventional database, a blog might have one table that stores posts and another table that stores comments. A JOIN is then required to pull out all the comments along with a particular post. With a non-relational database, one &#8220;collection&#8221; (the non-relational version of a <em>table</em>) would store all of the posts. Each comment associated with a post would be stored as part of that post&#8217;s record within the collection. This means that one record (or &#8220;document&#8221;, in non-relational terms) might contain just the post and no comments, another record might contain a much longer post and hundreds of comments. The benefit is that when you go to retrieve an individual post, you&#8217;re automatically retrieving all the associated information (e.g., the comments for that post). Non-relational databases really are the opposite of a normalized database, taking more of an object-oriented approach to data storage and retrieval. The hardest thing about using a non-relational database may be going against years of relational database training.</p><p>There are a number of non-relational databases out there; the key ones I&#8217;ve come across are <a
href="http://www.mongodb.org">MongoDB</a> (<a
href="http://www.larryullman.com/2011/04/12/looking-ahead-mongodb/">I&#8217;ve written more about MongoDB separately</a>), <a
href="http://neo4j.org/">Neo4j</a>, <a
href="http://cassandra.apache.org/">Cassandra</a>, and <a
href="http://couchdb.apache.org/">CouchDB</a> (Cassandra and CouchDB are both Apache projects, which is a always a good thing). The benefits of using non-relational databases are most important for sites with <em>a lot</em> of activity and data. And by &#8220;a lot&#8221;, I mean on a Facebook or near-Facebook level. I believe non-relational databases should be on the Web developer&#8217;s radar, but I&#8217;m not suggesting we should all jump ship on relational databases just yet; most sites don&#8217;t have the performance issues that non-relational database solve and do have the need for data integrity that relational databases offer.</p><p>The creators of CouchDB and SQLite have <a
href="http://www.infoworld.com/d/data-center/couchbase-sqlite-launch-unified-nosql-query-language-168470?source=IFWNLE_nlt_wrapup_2011-07-29">just announced</a> a new query language called <a
href="http://wwww.unqlspec.org/">UnSQL</a>, for &#8220;Unstructured Data Query Language&#8221;, pronounced &#8220;Uncle&#8221;. The hope is that UnQL can do for non-relational databases what SQL did for relational ones: provide a common way of interacting with the underlying database, without too much regard for the database application itself. The project is also being supported by Microsoft, for whatever that&#8217;s worth.</p><p>For a long discussion of non-relational databases, check out <a
href="http://www.infoworld.com/d/data-explosion/no-sql-new-databases-new-applications-400?source=IFWNLE__2011-07-25">this article at InfoWorld</a>. I also benefited from the posts at <a
href="http://seancoates.com/">Sean Coates&#8217;s blog</a>, discussing the initial <a
href="http://seancoates.com/blogs/gimme-bar-one-year-old">adoption of CouchDB</a>, and the <a
href="http://seancoates.com/blogs/gimme-bar-on-mongodb">switch to MongoDB</a> on a project.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/07/29/more-on-non-relational-aka-nosql-databases/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Looking Ahead: MongoDB</title><link>http://www.larryullman.com/2011/04/12/looking-ahead-mongodb/</link> <comments>http://www.larryullman.com/2011/04/12/looking-ahead-mongodb/#comments</comments> <pubDate>Tue, 12 Apr 2011 01:40:24 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[database]]></category> <category><![CDATA[mongodb]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=2485</guid> <description><![CDATA[Someone, I forget who (sorry), referred me to MongoDB, some time back. I haven&#8217;t written about this yet, as I was having trouble &#8220;getting&#8221; MongoDB. This isn&#8217;t going to be an exhaustive introduction to MongoDB, but I want to explain what I finally &#8220;got&#8221;. And although that I&#8217;m still not sure MongoDB is right for [...]]]></description> <content:encoded><![CDATA[<p>Someone, I forget who (sorry), referred me to <a
href="http://www.mongodb.org">MongoDB</a>, some time back. I haven&#8217;t written about this yet, as I was having trouble &#8220;getting&#8221; MongoDB. This isn&#8217;t going to be an exhaustive introduction to MongoDB, but I want to explain what I finally &#8220;got&#8221;. And although that I&#8217;m still not sure MongoDB is right for me, today at least, it definitely seems to be something worth keeping an eye on going into the future.<span
id="more-2485"></span><a
href="http://www.mongodb.org/display/DOCS/Use+Cases">According to their Web site</a>, MongoDB excels at high demand applications, with good caching, scalability,and replication. On the same page, the documentation says that MongoDB is &#8220;Less Well Suited&#8221; for &#8220;Problems requiring SQL&#8221;. This, of course, is where I get confused! In order to &#8220;get&#8221; MongoDB, you have to drop what you know, and believe, about how relational databases are organized and used. Because MongoDB is not a relational database.</p><p>MongoDB is an open-source <em>document-oriented</em> database. Instead of storing rows of data in tables, MongoDB stores data as Documents in Collections. Documents are represented using the <a
href="http://bsonspec.org/">BSON</a> format, which is extremely similar to JSON (in fact, there&#8217;s a strong relationship between MongoDB and JavaScript).</p><p>Now this may still sound a lot like the DBMS you&#8217;re used to (probably MySQL), but there are big differences here. For starters, and this is a big one, a <em>document-oriented database is not normalized</em>. If you&#8217;re storing a Collection of books, every book is a Document in itself. And each Document includes every attribute of that particular book: author, page count, ISBN, publisher information, and so forth. If one book has multiple authors, all of that information goes within that Document. If you want to include the publisher&#8217;s information with a book, that goes in the Document, too. This is not a normalized database, where related information is spread out over multiple tables. For many people, including me, this is a pretty foreign concept.</p><p>Secondarily, each document in a collection can have different attributes. If one book record has a link to a corresponding Web site, that&#8217;s fine. And it&#8217;s fine if other documents don&#8217;t have that attribute. Crazy, eh?</p><p>When it comes time to retrieve stored data, a single &#8220;find&#8221; command can retrieve a single document, including all its properties, or every document, using any attribute of your choosing to limit the selection. Because the database is not relational, no JOINs are required.</p><p>If you&#8217;re still thinking that this is snake oil, an argument for using MongoDB can be found on their <a
href="http://www.mongodb.org/display/DOCS/Production+Deployments">list of organizations that recently started using it</a>: Shutterfly, Foursquare, bit.ly, Intuit, LexisNexis, SourceForge, GitHub, The New York Times, and more. Those are big names. Now, aside from SourceForge, most aren&#8217;t using MongoDB for their primary applications, but they are adopting it in one way or another. If you have the time, on that page are links to several articles and presentations by those companies as to why and how they began using MongoDB.</p><p>Now, the MongoDB documentation clearly states there are situations where it&#8217;s not an appropriate choice, most specifically applications, such as banking and perhaps e-commerce, that require transactions (as MongoDB does not support transactions). Personally, I always take it as a sign of credibility when companies (or people) admit to their own shortcomings. You would also want to think twice, or three times, before converting an existing RDBMS-based application to MongoDB. The fact that MongoDB does not support SQL means you&#8217;d have to change a lot of your existing code to make such a conversion.</p><p>Speaking of which, there are drivers for MongoDB in all the popular languages, including my personal favorite, <a
href="http://www.mongodb.org/display/DOCS/PHP+Language+Center">PHP</a>. The MongoDB driver is in PECL and is <a
href="http://www.php.net/manual/en/class.mongodb.php">documented in the PHP manual</a>.</p><p>If you want to learn more about MongoDB, I&#8217;d recommend the links found on list of organizations that recently started using MongoDB page, plus the following:</p><ul><li><a
href="http://kylebanker.com/blog/2010/04/30/mongodb-and-ecommerce/">MongoDB and Ecommerce</a>, from the book &#8220;MongoDB in Action&#8221;.</li><li>A <a
href="http://open.blogs.nytimes.com/2010/05/25/building-a-better-submission-form/">New York Times article</a> on building their product, &#8220;Stuffy&#8221;, using Ruby on Rails and MondoDB.</li><li>An <a
href="http://www.nosqldatabases.com/main/2011/1/6/q-a-with-kenny-gorman-data-architect-for-shutterfly-inc.html">interview with a data architect at Shutterfly </a>on their decision to use MondoDB.</li><li>An <a
href="http://www.businessinsider.com/how-we-use-mongodb-2009-11">article on how BusinessInsider.com</a> uses MondoDB.</li><li>The <a
href="http://en.wikipedia.org/wiki/MongoDB#References">WikiPedia list of references on MongoDB</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2011/04/12/looking-ahead-mongodb/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Designing Databases</title><link>http://www.larryullman.com/2009/12/03/designing-databases/</link> <comments>http://www.larryullman.com/2009/12/03/designing-databases/#comments</comments> <pubDate>Thu, 03 Dec 2009 10:18:37 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[database]]></category> <category><![CDATA[design]]></category> <category><![CDATA[normalization]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=144</guid> <description><![CDATA[A few months back I came across a resource for designing databases (it was posted in a MySQL discussion list). Database Answers has tons of sample designs (a.k.a., models) for various situations. What the site lacks in attractive design in more than makes up for in its usefulness. There are hundreds of designs for you [...]]]></description> <content:encoded><![CDATA[<p>A few months back I came across a resource for designing databases (it was posted in a MySQL discussion list). <a
href="http://www.databaseanswers.org/data_models/">Database Answers</a> has tons of sample designs (a.k.a., models) for various situations. What the site lacks in attractive design in more than makes up for in its usefulness. There are hundreds of designs for you to consider, covering everything from &#8220;dog whisperer&#8221; to event reservations to online banking. Definitely worth looking at when you&#8217;re thinking about the database scheme for your next project.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/12/03/designing-databases/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>MySQL Offshoot: MariaDB</title><link>http://www.larryullman.com/2009/05/05/mysql-offshoot-mariadb/</link> <comments>http://www.larryullman.com/2009/05/05/mysql-offshoot-mariadb/#comments</comments> <pubDate>Tue, 05 May 2009 13:15:32 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[database]]></category> <category><![CDATA[mariadb]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=390</guid> <description><![CDATA[In 2008, Sun purchased MySQL for a reported $1 billion (US) and Sun has since been purchased by Oracle. Monty Widenius, the original creator of MySQL, has since left Sun, apparently over philosophical differences. In particular there seems to be a difference of opinion when it comes to the appropriateness of the 5.1 release of [...]]]></description> <content:encoded><![CDATA[<p>In 2008, Sun purchased MySQL for a reported $1 billion (US) and Sun has since been purchased by Oracle. Monty Widenius, the original creator of MySQL, has since left Sun, apparently over philosophical differences. In particular there seems to be a difference of opinion when it comes to the appropriateness of the 5.1 release of MySQL (i.e., was it too buggy for public release). Widenius is now working on <a
href="http://askmonty.org/wiki/index.php/MariaDB">MariaDB</a>, an offshoot of MySQL that uses the <a
href="http://askmonty.org/wiki/index.php/Maria">Maria storage engine</a> (aka table type) by default. This is definitely a project to keep an eye on, as MySQL users will logically move to MariaDB if they do find MySQL to be increasingly unstable or they just disagree with how Sun/Oracle is managing the product. As with many things, the popularity of MariaDB will partially depend upon the adoption rates by hosting companies. Or, for those that do stick with MySQL, version 6 will include support for the Maria storage engine. <a
href="http://askmonty.org/wiki/index.php/MariaDB_versus_MySQL">See this page for more on MariaDB compared with MySQL</a>.</p><p>The intention behind MariaDB is to release free and stable, but very similar, alternative to MySQL. The Maria storage engine is a crash-safe version of the MyISAM table type but Maria still doesn&#8217;t use transactions (like InnoDB). Version 1.5 of MariaDB is now in beta, with the focus on stability. Version 2 of Maria should include transactions and ACID compliance. Version 2.5 is where the developes intend to really focus on performance. This may seem a little backwards, but it&#8217;s much easier to retroactively improve software performance than it is its quality.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/05/05/mysql-offshoot-mariadb/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Using an Encrypted Local Database in Adobe AIR</title><link>http://www.larryullman.com/2009/04/07/using-an-encrypted-local-database-in-adobe-air/</link> <comments>http://www.larryullman.com/2009/04/07/using-an-encrypted-local-database-in-adobe-air/#comments</comments> <pubDate>Tue, 07 Apr 2009 22:00:46 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[database]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=383</guid> <description><![CDATA[An article I wrote for Peachpit Press titled Using an Encrypted Local Database in Adobe AIR was just published at Peachpit&#8217;s Web site. In this article I discuss and demonstrate a feature added to Adobe AIR in version 1.5. This addition allows you to securely store data in a database on the client&#8217;s computer (previous [...]]]></description> <content:encoded><![CDATA[<p>An article I wrote for <a
href="http://www.peachpit.com">Peachpit Press</a> titled <em>Using an Encrypted Local Database in Adobe AIR</em> was just <a
href="http://www.peachpit.com/articles/article.aspx?p=1330176">published at Peachpit&#8217;s Web site</a>. In this article I discuss and demonstrate a feature added to Adobe AIR in version 1.5. This addition allows you to securely store data in a database on the client&#8217;s computer (previous versions of AIR supported both databases and encrypted local storage, but not encrypted local databases).</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/04/07/using-an-encrypted-local-database-in-adobe-air/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>JetProfiler for MySQL</title><link>http://www.larryullman.com/2009/03/22/jetprofiler-for-mysql/</link> <comments>http://www.larryullman.com/2009/03/22/jetprofiler-for-mysql/#comments</comments> <pubDate>Sun, 22 Mar 2009 13:47:33 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[database]]></category> <category><![CDATA[performance]]></category> <category><![CDATA[software]]></category> <category><![CDATA[utilities]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=354</guid> <description><![CDATA[I&#8217;ve just recently come across a piece of software called Jet Profiler for MySQL. This is a program that runs on Mac OS X, Linux, and Windows (it&#8217;s runs on Java), and comes in both a free and commercial version. Jet Profiler for MySQL is a diagnostic tool, used to analyze and report upon your [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve just recently come across a piece of software called <a
href="http://www.jetprofiler.com/">Jet Profiler for MySQL</a>. This is a program that runs on Mac OS X, Linux, and Windows (it&#8217;s runs on Java), and comes in both a free and commercial version. Jet Profiler for MySQL is a diagnostic tool, used to analyze and report upon your database&#8217;s performance, specifically in terms of the queries run, the tables used, and the MySQL users. It also has more advanced capabilities, like reporting upon master/slave relationships, locking, threads, and so forth. One particularly interesting feature is that it doesn&#8217;t require any special server configuration; in fact, it doesn&#8217;t even need to be installed on the server. You can install the application on your desktop computer, create a new MySQL user on the server, and the software will connect through it. Software like this is another good way to better understand your database and your Web application.</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/03/22/jetprofiler-for-mysql/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Recreating MySQL Databases</title><link>http://www.larryullman.com/2009/01/31/recreating-mysql-databases/</link> <comments>http://www.larryullman.com/2009/01/31/recreating-mysql-databases/#comments</comments> <pubDate>Sat, 31 Jan 2009 16:29:56 +0000</pubDate> <dc:creator>Larry</dc:creator> <category><![CDATA[MySQL]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[database]]></category><guid
isPermaLink="false">http://www.larryullman.com/?p=121</guid> <description><![CDATA[One of the more common MySQL-related questions I get is how to transfer a database from one computer to another, or just how to recreate one in general. There are command-line tools that come with the MySQL server expressly for this purpose (mysqldump and mysqlimport). However, most people prefer to avoid using command-line tools, if [...]]]></description> <content:encoded><![CDATA[<p>One of the more common MySQL-related questions I get is how to transfer a database from one computer to another, or just how to recreate one in general. There are command-line tools that come with the MySQL server expressly for this purpose (<strong>mysqldump</strong> and <strong>mysqlimport</strong>). However, most people prefer to avoid using command-line tools, if they can. You can also use the <a
href="http://dev.mysql.com/downloads/gui-tools/5.0.html">GUI MySQL Administrator</a>. This application has Backup and Restore options. (I write about the MySQL Administrator in my <a
href="http://www.amazon.com/gp/product/0321375734?ie=UTF8&amp;tag=dmcinsiinc-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321375734">MySQL, Second Edition (Visual QuickStart Guide)</a><img
style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=dmcinsiinc-20&amp;l=as2&amp;o=1&amp;a=0321375734" border="0" alt="" width="1" height="1" /> book.) That&#8217;s a fine application, but you may not be able to run a GUI tool on the destination server (e.g., a hosted Web site). What I almost always use is <a
href="http://www.phpmyadmin.net">phpMyAdmin</a>. This Web-based PHP interface to MySQL is installed on pretty much every hosted server and you can quickly install it on your own computer as well. Here&#8217;s how you would use it&#8230;<span
id="more-121"></span>Start by installing phpMyAdmin on the computer that has the original database (the one being transferred or recreated). Load the URL of that phpMyAdmin install in a Web browser. For your own computer, you may just be going to <strong>http://localhost/phpMyAdmin</strong> or whatever. Then select the database from the left-hand column, if multiple databases are presented to you. Then click on the Export link or the Export tab, depending upon what&#8217;s presented to you. On the following page, this is what I normally do:</p><ul><li>Click <em>Select All</em> under Export to backup every table.</li><li>Check <em>Add DROP TABLE</em> under SQL options &gt; Structure so that the recreation of the database wipes out the existing database (note that you may not always want to do this).</li><li>Check either <em>zipped</em> or <em>gzipped</em> under Save as file. This will automatically check the Save as file box for you.</li></ul><p><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2009/01/picture-1.png"><img
class="alignright" style="border: 0pt none; margin: 2px;" title="phpMyAdmin Export" src="http://cloudfront.larryullman.com/wp-content/uploads/2009/01/picture-1-300x277.png" alt="phpMyAdmin Export" width="300" height="277" /></a>Once you&#8217;ve done this, click on <em>Go</em>. You&#8217;ll then be prompted to save the downloaded file to your computer, as you would any file downloaded through a browser. The result is a text file of the SQL commands used to recreate the entire database, from creating the tables to populating them. If you checked a compression type, it&#8217;ll be a compressed text file. You can now use this file as a saved backup of your database, edit the commands if needed, or remake the database from it. To do that&#8230;</p><p>Load the version of phpMyAdmin that&#8217;s running on the destination server, for example <strong>http://www.example.com/phpMyAdmin</strong>. This really must be running behind a restricted area (i.e., requiring authentication to access it), preferably over a secure connection. Then click on the Import link or tab, depending upon what options are presented. Then click the Browse button to select the database backup file (the one already created, now stored on your computer). Then click <em>Go</em>. That&#8217;s all there is to it!</p><p><a
href="http://cloudfront.larryullman.com/wp-content/uploads/2009/01/picture-3.png"><img
class="size-medium wp-image-234 alignleft" style="border: 0pt none; margin: 2px;" title="phpMyAdmin Import" src="http://cloudfront.larryullman.com/wp-content/uploads/2009/01/picture-3-300x170.png" alt="phpMyAdmin Import" width="300" height="170" /></a>This works for me without fail probably 95% of the time. The biggest issue I run across is that the upload limit in the Import tab is 2MB. For large databases, like my forum, one text file—even compressed—is way too large. In such situations, I open up the SQL text file in a text editor, then copy and paste the commands into separate files until they are all under 2MB when compressed. At that point, it&#8217;s just a matter of doing multiple imports, one for each file.</p><p>As I said, I get asked about this a lot, but it&#8217;s really quite simple, thanks to phpMyAdmin. Let me know what questions or comments you may have!</p> ]]></content:encoded> <wfw:commentRss>http://www.larryullman.com/2009/01/31/recreating-mysql-databases/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Served from: www.larryullman.com @ 2012-05-21 14:41:19 by W3 Total Cache -->
