7

For teaching and testing purposes I would like to run MySQL without actually having to install it.

I have found portable PostgreSQL for both Macintosh and Windows, which is good, but have been unable to find the same for mySQL.

I know that I can run MySQL from the popular web server packages, such as AMPPS and XAMPP, but they need installing anyway, and are over the top for my requirements.

Is there a portable app for OS X and for Windows which will do the job?

Thanks

  • 3
    Probably not what you mean, but there is even an embedded version available, which can be linked to your application so no "external" service is needed. – jkavalik Jun 3 '16 at 18:48
6

Yes you can have MySQL as independent ZIP archive and it is also available for download in MySQL download page for windows, do the following steps

  • Download ZIP archive
  • Extract/UN-zip the archive
  • Change the default ini file if needed
  • You may also install service or start mysqld from cmd prompt using

    cd \bin
    mysqld.exe

or if service is needed to be installed

cd \bin mysqld.exe --install MySQL Service Name --defaults-file=Absolute Path to .ini file

  • use mysql.exe -uroot to login MySQL

The ZIP archive is also available for UNIX* OS

Hope it helps

0

A small sidenote on what you said:

I know that I can run MySQL from the popular web server packages, such as AMPPS and XAMPP, but they need installing anyway, and are over the top for my requirements.

It is possible to install XAMPP in a portable way, just download the zip package from http://sourceforge.net/projects/xampp/files/ (pick your desired version) and follow the quick setup.

0

In this day and age (as well as back in 2016) portable anything, including MySQL can and should be run as a Docker container.

  • Running Docker on Windows is a challenge, and for Macintosh and Windows it also requires installation, which is what I have been trying to avoid. – Manngo Nov 15 at 22:21
0

SQLite sounds like what you want.

  • 1
    Nice one, +1 for a decent first contribution. See my answer here for my thoughts on SQLite as a solution in this case. Unless you're teaching complex database concepts such as transaction isolation levels in a multi-user environment, SQLite works fine! p.s. welcome to the forum! :-) – Vérace Nov 16 at 7:40
0

The questions:

  • 1) For teaching and testing purposes I would like to run MySQL without actually having to install it.

  • 2) Is there a portable app for OS X and for Windows which will do the job?


The answers:

  • 1) For teaching and testing MySQL's relationship with the ISO SQL standard has always been, err..., problematic. I will give them credit for having become better in recent years.

  • 2) For portability, you can use SQLite - it's a rock solid, very standards compliant database which will run off a memory stick. There are a number of videos from the creator of SQLite on YouTube!

From here

SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine. SQLite is the most used database engine in the world. SQLite is built into all mobile phones and most computers and comes bundled inside countless other applications that people use every day. More Information...

The SQLite file format is stable, cross-platform, and backwards compatible and the developers pledge to keep it that way through at least the year 2050. SQLite database files are commonly used as containers to transfer rich content between systems 1 3 and as a long-term archival format for data [4]. There are over 1 trillion (1e12) SQLite databases in active use [5].

From here, SQLite is the "Protégé of PostgreSQL" - its primary developer, D. Richard Hipp is always up front about how he models copies PostgreSQL syntax.

It's approx. 2MB (yes, MB, not GB!) and is probably better (for teaching purposes), and certainly more standards compliant, than MySQL. See this page for a comprehensive (and very honest) assessment of the pros and cons of SQLite - in your use case, I would pay particular attention to the Education and Training section. It is gratifying, in these days of endless marketing jargo-babble to see a vendor1 be so up-front and honest about a product!

1SQLite is not a vendor in the classic sense, it's public domain software, however if you watch D. Richard Hipp's videos on YouTube, it rapidly becomes clear that he makes his crust from servicing the needs of commercial clients, of which there are many!

  • There are too many differences between SQLite and MySQL to make it practical. And certainly it has its own issues with ISO standards (see sqlite.org/quirks.html). Certainly I would recommend SQLite for light duty data management, and PostgreSQL for heavier duty. However, MySQL dominates in the web development space, so developers will need to get a feeling for it. – Manngo Nov 16 at 8:25
  • Thanks for link, +1 your question for that! :-) It shows (it seems to me) that if one uses standards-compliant SQL, all is hunky-dory! Here is an example of what you can do with MySQL (other examples). I still suggest that SQLite is by far and away your best solution, but if you want standards compliance, your best bet might be Postgres portable? – Vérace Nov 16 at 10:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.