10

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

Manngo
  • 3,065
  • 10
  • 38
  • 61

5 Answers5

8

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

Nawaz Sohail
  • 1,480
  • 3
  • 10
  • 25
1

SQLite sounds like what you want.

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.

Gruber
  • 101
  • 2
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!

Vérace
  • 30,923
  • 9
  • 73
  • 85
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.

mustaccio
  • 28,207
  • 24
  • 60
  • 76