Category: Database

MySQL (102)
Oracle (26)
Redis (8)
SQLServer (2)

MySQL Data Recovery

Accidental database data deletion is a common occurrence, making data recovery an essential fundamental skill for DBAs. A more rudimentary approach is to pull a historical backup and restore it on a separate machine, but this method often consumes considerable …

FLUSH TABLES WITH READ LOCK vs LOCK TABLES

Today, while resolving a database synchronization issue, I used the flush tables with read lock command and took the opportunity to learn more about table locking. 1. FLUSH TABLES WITH READ LOCK This command enforces a global read lock; after executing it …

How to Clear MySQL log-bin Logs

Lately I’ve been swamped with work projects, and now with departmental restructuring I’ll be moving to a new project. I’m pretty excited to dive into a lot of new knowledge again. After getting off work today, I checked on my VPS status and found that my VPS only had about 1 GB of disk space left! My first reaction was that it had been hacked …

MySQL Master-Slave Replication Configuration Guide

How to Configure MySQL 5 Master-Slave Replication
I. Choosing the Installation Package
mysql-mysql-5.0.77
II. Installation Environment
Two Red Hat Enterprise Linux AS release 4 (Nahant Update 5) virtual machines
Master Server: 192.168.126.118
Slave Server: 192.168.126.166
III. Master Server …

How to Install MySQL on CentOS

With nothing to do this afternoon and bored out of my mind, I just set up an FTP server, which is basically just for show since I rarely use it. So I figured I’d install MySQL to learn a bit. I installed it with yum install mysql, then ran mysql and got:
ERROR 2002 (HY000): Can't connect to local MySQL server through socke …

How to Reset a Forgotten MySQL Password

When using MySQL databases, we often run into the problem of forgetting the MySQL password. I’ve encountered this myself, and I searched online for many solutions but couldn’t resolve it (the web is full of reposted content…). In the end, I figured it out on my own and came up with a solution for resetting a forgotten MySQL password …

MySQL SHOW STATUS Explained

The server maintains many status variables that provide operation-related information. You can view these variables and their values using the SHOW STATUS statement, and through these values, discover some key issues currently present in the database. For example, if Opened_tables is too large, then your table_cache variable…

Super Practical MySQL Database Common Commands Guide

1. Common MySQL Commands create database name; Create database use databasename; Select database drop database name Delete database directly, without prompt show tables; Display tables describe tablename; Detailed description of the table Add distinct to select …

How to Set Up Mutual MySQL Backup and Synchronization

MySQL supports unidirectional, asynchronous replication, in which one server acts as the master server while one or more other servers act as slave servers. The master server writes updates to binary log files and maintains an index of the log files to track log rotation.

When a slave server …