Tag archive for: database

How to setup phpMyAdmin on a Raspbian Stretch Lite, Nginx, MariaDB / MySQL and PHP 7 LEMP stack

The phpMyAdmin project is a solid software tool written in PHP, that can help us handle the administration of MySQL / MariaDB over the web.

phpMyAdmin Demo Server 4.7.8 demo screenshot

If you want to build your next project with a Raspbian Stretch Lite, Nginx, MariaDB / MySQL and PHP 7 LEMP stack, you may want to consider setting up phpMyAdmin as well. This post details how you can do so.

How to migrate your MongoDB database instance with mongodump, mongorestore, tar and scp

Migration of MongoDB database is part and parcel of DevOps, especially when you are running your own projects.

MongoDB provides us with two utilities for performing database migration – mongodump and mongorestore.

A simple MongoDB database migration can be performed in 5 steps:

  1. Use the mongodump command to export the data of a MongoDB database instance as files in the source server’s filesystem.
  2. Use the tar command to compress the exported files as a single .tar.gz file in the source server’s filesystem.
  3. Use the scp command to send the .tar.gz file from the source server to the destination server.
  4. Use the tar command to decompress the .tar.gz file at the destination server.
  5. Use the mongorestore to import the extracted files into the destination MongoDB database.

This post discusses how you can perform MongoDB database migration with utilities provided by MongoDB and most Linux servers.

SQL query to find foreign key constraints that reference columns in a table in oracle database

I was rather new to a system with hundreds of Oracle database tables. There was once when I realized that I had to delete a redundant row from the SYSTEMS_CONFIGURATION table.

As there are foreign key references to the SYSTEMS_CONFIGURATION table, I had to first remove all foreign key references to the redundant SYSTEMS_CONFIGURATION table row prior to deleting it.

This post captures the SQL query which I had ran on my Oracle database to find all the tables which had foreign key references to SYSTEMS_CONFIGURATION table, so that I can write the SQL update statements to delete all child references to the redundant SYSTEMS_CONFIGURATION row prior to deleting it.

Getting documents from MongoDB collections with PHP

We have a MongoDB server running as a windows service on the same machine as our web server. Over time, this MongoDB server had been listening on port 33333 to help us remember information that we had collected about our friends.

As time passes, our memory can hardly rival that of our MongoDB server, which was designed to help us recollect information efficiently. This post documents some proof of concept that I did for querying documents from MongoDB collection via the PHP driver.