Notes
Installing MySQL on MacOS
- By Ercan
- 26/06/2025
If you're developing locally on a Mac and prefer running MySQL natively instead of using Docker, this guide is for you. I personally run several personal projects on my MacBook and want my data to persist without relying on containers. Here’s how to install and secure MySQL using Homebrew, with architecture-specific instructions for Apple Silicon and Intel-based Macs. Step 1: Install MySQL brew install mysql By default, MySQL creates a root user without a password. For security reasons, I prefer setting a password manually. Step 2: Start MySQL Temporarily brew services ..
Installing PostgreSQL on MacOS
- By Ercan
- 26/06/2025
If you're working on personal projects and prefer running PostgreSQL directly on your Mac instead of using Docker, you're not alone. While containerization is great for many use cases, sometimes you just want your database to live natively on your machine — especially when you care about persistent data and minimal overhead. In this guide, I’ll walk you through installing PostgreSQL 18 using Homebrew on macOS, with separate instructions for Apple Silicon and Intel-based Macs. Step 1: Install PostgreSQL brew install postgresql@18 By default, Homebrew initializes a database clust..
Advanced Oracle SQL Query Examples
- By Ercan
- 15/06/2025
When working with Oracle databases, you often go beyond simple SELECT statements. Real-world data is hierarchical, analytical, and sometimes messy. In this article, we’ll explore powerful Oracle SQL techniques that solve complex data problems — using realistic examples and sample tables. We’ll cover partitions, hierarchies, analytics, and more. Each example includes setup scripts and queries you can run directly in your Oracle environment. Sample Schema Setup Let’s start by creating two simple but related tables: departments and employees. CREATE TABLE departments ( dept_id ..
PostgreSQL Advanced Query Examples
- By Ercan
- 15/05/2025
PostgreSQL is known for its standards compliance and performance — but what truly sets it apart is its depth. Beyond the typical SELECT, JOIN, and WHERE statements lies a powerful set of query features that can make your SQL far more expressive and efficient. In this article, we’ll explore advanced PostgreSQL queries that go beyond the basics — including recursive CTEs, partitioned tables, JSONB filtering, window functions, and more. Each example includes simple schema setup statements, so you can try them out directly in your environment. 1. Recursive CTE: Handling Parent–Child Relati..
Backing Up and Restoring PostgreSQL Databases
- By Ercan
- 17/04/2025
This guide outlines the steps to back up and restore PostgreSQL databases using command-line tools on Windows. Backing Up a Database To back up a PostgreSQL database, use the `pg_dump` utility: .\pg_dump.exe -U <username> -d <database_name> > <dump_path> Example: .\pg_dump.exe -U postgres -d testdb > C:\Users\Ercan\Desktop\db_dump.sql Backing Up a Table To back up a PostgreSQL table, use the `pg_dump` utility: .\pg_dump.exe -U <username> -d <database_name> -t <table_name> > <dump_path> Example: .\pg_dump.e..
Backing Up and Restoring MongoDB
- By Ercan
- 17/04/2025
This guide outlines the steps to back up and restore MongoDB databases using the official MongoDB Database Tools. 1. Download MongoDB Database Tools Obtain the MongoDB Database Tools from the official website: https://www.mongodb.com/try/download/database-tools 2. Backing Up a Database Use the `mongodump` utility to create a backup of your database: .\mongodump.exe --db=<<db_name>> --out <<dump_path>> Replace `<<db_name>>` with the name of your database and `<<dump_path>>` with the desired output directory. 3. Restoring ..
Installing PHP Xdebug on Windows
- By Ercan
- 17/04/2025
This guide outlines the steps to install and configure Xdebug for PHP on a Windows environment. 1. Download the Appropriate Xdebug DLL Visit the official Xdebug downloads page to obtain the DLL that matches your PHP version: https://xdebug.org/download#releases 2. Rename and Move the DLL File Rename the downloaded file to `php_xdebug.dll` and move it to the `ext` directory within your PHP installation path (e.g., `C:\php\ext`). 3. Update php.ini Configuration Open your `php.ini` file and add the following configuration: [xdebug] zend_extension=xdebug xdebug.mode=deb..
Backing Up and Restoring GPG Keys
- By Ercan
- 17/04/2025
This guide outlines the steps to back up and restore your GPG keys, ensuring the security and continuity of your cryptographic identity. Backing Up GPG Keys 1. Export the Secret Key To back up your secret GPG key, use the following command: gpg --export-secret-keys --armor > secret.asc This command exports your secret key in ASCII format to the file `secret.asc`. 2. Export the Trust Database (Optional) To back up your trust database, execute: gpg --export-ownertrust > trustdb.txt This will save your trust settings to `trustdb.txt`. Restoring GPG Keys ..
Installing Podman on Windows
- By Ercan
- 17/04/2025
This guide outlines the steps to install Podman on a Windows environment. 1. Enable Required Windows Features Open PowerShell as Administrator and execute: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart Restart your computer to apply the changes. 2. Install WSL 2 Download and install the latest WSL 2 update from: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi 3. Set WSL 2 as Default Version In PowerShell,..
Changing Podman Data Directory on Windows
- By Ercan
- 17/04/2025
This guide outlines the steps to change the Podman data directory on a Windows environment by exporting and importing the WSL instance. 1. Stop the Podman Machine Execute the following command to stop the Podman machine: podman machine stop 2. Export the WSL Instance Export the existing WSL instance to a backup file: wsl --export <<instance_name>> backup.tar 3. Unregister the WSL Instance Unregister the current WSL instance: wsl --unregister <<instance_name>> 4. Import the WSL Instance to New Location Import the WSL instance to t..
