Install MariaDB portable

It's straight forward to install a portable version of MariaDB that you can run from a USB memory stick, or any other location on you disk. Portable means no heavy overload, no writing across your hard drive, no added registry entries. Noting is installed and there is noting to uninstall. If you want to remove the software, then you just delete the folder where you unpacked the software.

The following example is for Windows 10, but you can choose any other of the listed OS.

  1. Go to https://downloads.mariadb.org/mariadb/10.4.11/ and download mariadb-10.4.11-winx64.zip.
  2. Unzip the file, in this example I unpacked the file on the desktop. So, now I got a folder on my desktop called mariadb-10.4.11-winx64, and in this folder I have the following structure:

3. Open the terminal, i.e. command prompt, and CD into the bin folder as shown in the image below.

4. Run the command

mysql_install_db.exe

This will setup the system database. ONLY DO THIS ONE TIME! See screenshot below.

5. Start the database by running

mysqld.exe --console

Note, you might get a warning from the firewall, and need to set some permissions. Only allow access on your local network. When the server is running, the console should like as shown below. Note the last two lines, ready for connections and port 3306. You can now minimize this console window, BUT DO NOT CLOSE IT! If you close the window, you will shut down the server. In the next step we will check the server is running.

6. Open a new terminal windows, i.e. a new Command Prompt window. And again, do not close the terminal windows that is running the server. In the new terminal window, cd into the bin folder, just as we done previously, and type

 mysql --version

If everything works, you should see something like is shown below

7. Set a password for the root account. Run the following command

mysqladmin -u root  flush-privileges password "SECRET"

Choose your password carefully, and remember it! Here I choose the password 'SECRET', which is probably one of the first guesses anyone would make. That is bad. Choose something more secure. Note, if you forget your password, then you must consider your database lost. There might still be hope, but it will take a lot of work, time, and expertise to recover your data!

Now, you can log in to you server by issuing the command

mysql -u root -p

See screenshot below.