The
Ultimate
Business Machine

Technology, business
and innovation.

And, not least, about
the Mac.

Weblog Archive Cutedge

by: Bernard Teo








Creative Commons License

Copyright © 2003-2012
Bernard Teo
Some Rights Reserved.

Mon 03 Sep 2012

New Preference Panes for our SQL Databases

Category : Technology/NewSQLPrefPanes.txt

I've wanted to be able to run both MySQL and MariaDB databases concurrently. So, since they both can't run on the same port 3306, which is the default for both, I need to be able to allow one of them to start up on an alternate port.

So, this is our new MariaDB Pref Pane. And I've changed the MySQL and PostgreSQL Preference panes to make them work the same way.

MariaDBPrefPaneWithPortField.gif

These Pref Panes are included in each of the respective SQL installers that we've built : MySQL_Installer_For_MacOSX, MariaDB_Installer_For_MacOSX, and PostgreSQL_Installer_For_MacOSX. 

I've tweaked the installers so they'll work well with the new Preference Panes.

Note: When you run MariaDB off a different port from MySQL, you also need to change the location of MariaDB's socket. Our Pref Pane does that for you (it creates a socket for MariaDB at /tmp/mariadb.sock so that it avoids clashing with MySQL's /tmp/mysql.sock). 

When you access MariaDB (or MySQL for that matter because they work exactly the same way) over localhost, the client doesn't use TCP ports. Instead the client and server connect over Unix sockets. 

So, if you have either MySQL or MariaDB running on a non-standard port, and you want to access it via localhost, you need a way to specify the non-standard socket location. 

This necessitates a change to Liya. So Liya 2.0.9 now has a feature whereby the user can specify the socket location, as shown below :

MariaDBSocket.gif

So, all in all, I've had a rather busy week.

Posted at 12:43AM UTC | permalink

Thu 30 Aug 2012

MySQL & MariaDB - Stuck

Category : Technology/MySQLMaraiDB-Stuck.txt

I've finished the Pref Panes and updated all my database installers so that the user can set up alternate port numbers for each of these databases to use. And all should be fine, so I can test and then release them.

And then I fnd that I'm stuck.

MariaDB tries so hard to be a "drop-in" replacement for MySQL that it also uses the same Unix sockets - /tmp/mysql.sock.

So I'm trying to get MariaDB to start off /tmp/mariadb.sock, say, for localhost connections, which seems to work, i.e., in the sense that MariaDB now listens to connections coming through /tmp/mariadb.sock. By using a custom my.cnf, that I get MariaDB to read its custom configuration parameters from, I can also get MariaDB to listen to port 33306, say, for incoming TCP connections.

So far, so good.

Now, I just need to get MariaDB's mysql command line program to know that the ports have now been changed from the defaults. 

/usr/local/mariadb/bin/mysql goes back to /tmp/mysql.sock when it attempts a database connection. So, MariaDB's own mysql client continues to talk to the existing MySQL installation, rather than to MariaDB. There's where I am stuck.

How to break this?

Posted at 4:25AM UTC | permalink

Tue 28 Aug 2012

Pref Panes With Port Number Field

Category : Technology/PrefPanesWithPortNo.txt

I've created new Pref Panes for each of the installers that we support—MySQL, PostgreSQL and MariaDB. These versions now include a Port Number field.

MySQLPrefPaneWithPortNo.gif

I built these so that I have a way to run MariaDB and MySQL at the same time (by default, they use the same port, 3306).

And also to figure out how Network Preferences and Sharing Preferences, among others, could have that lock icon at the bottom left hand corner and how to make that work for my own Pref Panes.

I'm now going back to change the way my MariaDB Installer for Mountain Lion works. In its first incarnation, it pretended to be MySQL and, if you have a running MySQL installation, the MariaDB installer will move all the databases you have on MySQL over to MariaDB.

But now, if I'm going to have MariaDB running as a separate database on its own right, the user may not want to mix the MySQL and MariaDB databases. So I'm going to make the MariaDB installer only upgrade a previous MariaDB installation and leave existing MySQL databases alone.

Note : It's actually very easy to copy MySQL databases over to MariaDB. You'll find the databases inside a "data" folder within the MySQL-x.x.x folder, with each database in its own folder (you can recognise them by their database names). Just copy them over to the corresponding "data" folder in the Mariadb-x.x.x main folder.

I'll release them when I'm done changing the MariaDB Installer.

Posted at 5:36AM UTC | permalink

Thu 23 Aug 2012

Liya & Luca

Category : Technology/LiyaAndLuca.txt

Although Luca is a paid app and Liya is free, both share the same database connector frameworks that allow the apps to access MySQL, Postgres, SQLite and, now, even MariaDB databases.

The value of keeping Liya free is that it's become very popular, especially among other software developers. 

Liya is today at the top 29th position among US business Mac apps, and is consistently within the top 20 positions in places like Japan, South Korea, Germany and Israel—places where you're likely to get quite sophisticated users.

And because these developers push the use of the Liya further and deeper than any Luca user, more bugs surface and get reported about the quality of our very crucial database connectors than if I didn't have Liya widely-used in the first place.

I wouldn't have been able to spot all the date—and especially time-stamp—handling bugs in Postgres and SQLite, if it's just me and Hai Hwee working on Luca. You need a wide net of other users working on a wider-range of their own stuff to push the use of the database connectors to the limits. 

And because we've fixed another one of these quite subtle date-time handling bugs, I've just updated Luca for Mountain Lion to 5.0.2.

I couldn't over-emphasise how crucial these database connectors are. They're what allows Luca to tap on to SQL databases, wherever in the world these databases are, and from whatever Mac OS X or iOS device the user happens to be running an app like Luca on.

Since the days when we were 4D (4th Dimension) developers and had to rely on third-party developers for 4D for Oracle, etc, (and to pay through our noses for them), I've been determined to build these connectors ourselves—to control their quality, their speed, and their dependability in mapping data values and data types between the client and its permanent data store.

We've reached this stage of control over our own work and I want to build on them to improve Luca and more apps like Luca in the coming months. Otherwise we would have wasted all these earlier years of hard work.

Posted at 3:33AM UTC | permalink

Liya 2.0.8

Category : Technology/Liya208.txt

I've just released version 2.0.8 of Liya. It includes one bug fix for SQLite date field handling. And I now make Liya able to open connections to MySQL and PostgreSQL databases on non-standard ports. 

This version has also been tested to work with Mariadb databases. And of course, it will also work on Mountain Lion.

I'm now ready to make Pref Panes for MySQL, PostgreSQL and MariaDB that will allow the user to start up the databases on non-standard ports. The primary motivation is so that users can fire up MySQL and MariaDB simultaneously. Currently, MariaDB being a "drop-in replacement" for MySQL, uses the exact same port as MySQL. If you want to have both databases running simultaneously, one or the other has to work on a different port.

And I've just submitted it to the Mac App Store. The last time, it took more than two weeks to get reviewed and approved. Let's see how long it takes this time.

Posted at 2:51AM UTC | permalink

Mon 20 Aug 2012

MariaDB Installer on Mac OS X Mountain Lion

Category : Technology/MariaDBOnMountainLion.txt

I've been wanting to do this for a while now. I've finally been able to build a Mountain Lion Installer for MariaDB, which is a "drop-in" replacement for MySQL.

As the word "drop-in" implies, you can use MariaDB, once it's installed, like you've always been using MySQL. MariaDB pretends to be MySQL and it will execute all the usual mysql commands, without your having to change a thing.

This version of the installer installs MariaDB-5.5.25 (the latest I can find) into /usr/local/mariadb-5.5.25 and makes a symlink to /usr/local/mysql which, in fact, points to /usr/local/mariadb-5.5.25.

So, all the mysql commands just work. Like if you do a 

mysql --version

in the command line, you will get :

Server version: 5.5.25-MariaDB Source distribution

and a MariaDB command prompt, but other than that you can work like you've always done in MySQL.

If you have a working MySQL database, like one that was installed by our own MySQL installer, the MariaDB installer will attempt to move your current databases over (if you choose to do the Upgrade option, rather than a Clean Install).

Finally, because MariaDB's command gets called when you execute /usr/local/mysql, even the MySQL Start Up Preferences Pane (that we've built together with our MySQL installer) continues to work.

So, what's the point of all this?

Well, many develoeprs are concerned over the future of MySQL, now that it's in the arms of Oracle. The existence of MariaDB, brought into life by the original developers of MySQL, gives hope that a free, independent, quality, database option continues to be available, should Oracle decide one day to close-source or worse kill, if it comes to that, MySQL.

So, this gives us a third option to work with—MySQL, Postgres and now MariaDB. I've just tested Liya (our friendly database table editor) with MariaDB and it continues to work. If MariaDB is running on your server instead of MySQL, simply choose MySQL as the database option to access your new MariaDB database.

Obviously, in this arrangement, MySQL has to be stopped from running, in order to have MariaDB run and impersonate it.

Maybe a future version of our installer will allow MariaDB to be run on another port alongside MySQL. But I will have to improve Liya so that it will accept a port number as a connection option. (Currently it doesn't have such an option.)

So, I hope now to use more of MariaDB and see what I can learn from it. If you do download the Installer, let me know if it works for you and also what you think of MariaDB. 

Posted at 8:59AM UTC | permalink

Sun 19 Aug 2012

Universal Lion & Mountain Lion SQL Installers

Category : Technology/UniversalSQLInstallers.txt

I've finally managed to build new MySQL and PostgreSQL installers that will work on both Lion and Mountain Lion.

The MySQL installer includes the latest 5.5.27 release, while PostgreSQL is now at 9.1.4.

These installers will also upgrade your current MySQL and PostgreSQL installations and bring the old databases over. You can choose to do a clean install or upgrade a previous version.

The MySQL 5.5.27 Installer is available here, and the PostgreSQL 9.1.4 Installer is available here. Remember they work on both Lion and Mountain Lion.

Posted at 6:32AM UTC | permalink

Fri 17 Aug 2012

New PostgreSQL 9.1.4 Installer for Mountain Lion

Category : Technology/PostgreSQL914Installer.txt

Okay, after quite a bit of trial and tribulation, I have a new PostgreSQL 9.1.4 database installer that will work on Mountain Lion. 

To edit these databases, just use Liya, an easy-to-use GUI for creating databases, tables, fields and data on these databases.

It's now ready for download by following the link, above.

Unfortunately version doesn't work on Lion. I'll have to find out why.

Also, I'm trying to build a new MySQL 5.5.27 installer but I keep having problems with cmake 2.8.8. I hate cmake.

Posted at 2:13PM UTC | permalink

PostgreSQL Installer for Mountain Lion

Category : Technology/PostgresInstallerForMLProgress.txt

My PostgreSQL Installer doesn't work on Mountain Lion. I've worked two weeks to find out that the problem is caused by a security measure taken by Apple to quarantine an object that it thinks has been downloaded from the Internet.

Let's say my friend, Hai Hwee, sends me the working files for the Postgres installer over the web. I open one of the scripts using TextEdit. Now, if I make a change to the script, TextEdit will most helpfully (not!) mark that script as quarantined, so it will refuse to run if executed from the Unix command line. But it does this marking most surreptitiously, as an extended file attribute, so you can't find anything amiss just by looking at the file or even listing it in Terminal.

That's what's causing my Postgres installer to fail in Mountain Lion. The installer couldn't run one script in the package - because it had been quarantined after being edited in TextEdit. 

Somehow, only TextEdit does that. TextWrangler doesn't. I wanted to remove TextEdit totally from my Mac, but I can't. The Mac says "it's needed by OS X".

So, I might as well work on a new version of the Installer. It'll include the very latest version of PostgreSQL.


Posted at 4:50AM UTC | permalink

Fri 10 Aug 2012

WebMon for Mountain Lion 6.0.1

Category : Technology/WebMon6dot0dot1.txt

There are bugs all over the place whenever we move from one major OS X version to the next.

This time it's WebMon. Somehow, delegate connections between a table view and its controller has to be deleted and re-created when we move from Lion to Mountain Lion. I don't know if this is pervasive or if this only hit that one unfortunate NSTableView in WebMon but it's a warning we've got to peek at every corner of our code when we move our apps to Mountain Lion.

So, the problem in WebMon's case manifests itself like this : you need to create an SSL certificate, so you change the default domain name from "localhost" to that of your main domain in the lists of domains. For convenience, I will automatically change the domain name that gets matched into the SSL cert. But in Mountain Lion, the SSL cert's domain name remains stuck at "localhost". Very fun. This has now been fixed in version 6.0.1.

I also took the opportunity to update the IP address-to-country lookup mechanism with the latest mappings, as of 10th August 2012.

WebMon for Mountain Lion version 6.0.1 is here.

I've finally found the time to update the documentation with the screen shots from the Mountain Lion version and also did some editing. But I'm really planning to build on top of this version, as soon as as these ML teething problems subside. I have still to update the Luca and MailServe documentation, though. But one step at a time.

Posted at 4:24AM UTC | permalink

Thu 09 Aug 2012

Apple Must Share?

Category : Technology/AppleMustShare.txt

Samsung’s 2010 Report Says its Galaxy Would Be Better If it Were Just More Like the iPhone.

Actually this is all pretty depressing. 

How can Samsung not have been copying Apple, with "slavishly" being a most appropriate word to describe all that? 

But I think Apple could still lose, the way they lost the last one with Microsoft. 

Because it's Apple against the whole of human nature. It reminds me of the scene in that Ayn Rand novel, Atlas Shrugged, when the protagonist Hank Rearden succeeded in developing a high grade metal that could be used, among other things, to build good strong railway tracks. One would have thought the rail company would be excited but, no, it organised a consortium of his antagonists, the other metallurgy companies, to deprive him of the fruits of this success and, not coincidentally, the power that could fall to him, though honestly earned. How? By claiming that his invention is so good, so important to the good of mankind, that it has to be shared. 

Sounds familiar? Google actually made that same argument about Apple rather recently.

So, read the comments that accompany such articles. All the Android (and ex-Microsoft) techies are praying for Apple to lose.

Posted at 12:56AM UTC | permalink

Liya 2.0.7, finally released on the Mac App Store

Category : Technology/Liya207OnMacAppStore.txt

Liya 2.0.7 is finally available from the Mac App Store

It's almost three weeks since I submitted it for review (and three weeks since I made 2.0.7 available on my own web site). So it shows the perils for a developer depending solely on the App Store mechanism for distribution to end users.

I believe the way forward is to still concentrate on building the quality of the software offering that I make available on my own web site.

If I build it (well), experience tells me the users will come.

Posted at 12:49AM UTC | permalink

Read more ...

Mac@Work
Put your Mac to Work

Sivasothi.com? Now how would you do something like that?

Weblogs. Download and start a weblog of your own.

A Mac Business Toolbox
A survey of the possibilities

A Business Scenario
How we could use Macs in businesses

VPN Enabler for Mavericks

MailServe for Mavericks

DNS Enabler for Mavericks

DNS Agent for Mavericks

WebMon for Mavericks

Luca for Mavericks

Liya for Mountain Lion & Mavericks

Postfix Enabler for Tiger and Panther

Sendmail Enabler for Jaguar

Services running on this server, a Mac Mini running Mac OS X 10.9.2 Mavericks:

  • Apache 2 Web Server
  • Postfix Mail Server
  • Dovecot IMAP Server
  • Fetchmail
  • SpamBayes Spam Filter
  • Procmail
  • BIND DNS Server
  • DNS Agent
  • WebDAV Server
  • VPN Server
  • PHP-based weblog
  • MySQL database
  • PostgreSQL database

all set up using MailServe, WebMon, DNS Enabler, DNS Agent, VPN Enabler, Liya and our SQL installers, all on Mavericks.