Skip to main content

Posts

Monitoring MySQL with Percona Monitoring and Management

In this blog post we will see how to monitor MySQL databases using the open source monitoring tool provided by Percona, referred as Percona Monitoring and Management (PMM). About PMM: Percona Monitoring and Management (PMM) is an open-source platform for managing and monitoring MySQL and MongoDB performance. It is developed by Percona in collaboration with experts in the field of managed database services, support and consulting. PMM is a free and open-source solution that you can run in your own environment for maximum security and reliability. It provides thorough time-based analysis for MySQL and MongoDB servers to ensure that your data works as efficiently as possible. Basic Requirements: 1. Need at least one Linux server to install PMM Client and PMM Server. 2. Need Operating System - root user credentials 3. Default port's(80) have to be open if using to or more servers. 4. A MySQL user is required to capture the Queries in the Database. 5. A Docker se
Recent posts

Installing,Starting,Stopping PostgreSQL Server on Linux OS

In this post, we will see how to Install and Run PostgreSQL on Linux machines. There are three ways to installation procedures to download the software. 1. Binary Installation 2. Yum Installation 3. RPM Installation In this post, will see how to install PostgreSQL using Binary installation. 1. Download the binaries from the official website. $ wget https://get.enterprisedb.com/postgresql/postgresql-9.6.2-4-linux-x64-binaries.tar.gz 2. Untar the downloaded binaries. $ tar -xvzf postgresql-9.6.2-4-linux-x64-binaries.tar.gz 3. Create appropriate data directories and permissions with root user to run PostgreSQL Server. # mkdir -p /var/lib/pgsql/data # chown -R psql /var/lib/pgsql/data # su psql 4. Now change the directory path to the downloaded software path $ cd /home/psql/softwares/pgsql 5. Initialize the data directories required for PostgreSQL to run, there are two ways to initialize the directories. $ initdb -D /usr/local/pgsql/data Alternatively, we can also

Installing and Using JSON on MySQL 5.7

As we know that MySQL come up with JSON datatype equivalent(but not completely) to MongoDB's Document Store Database. In this post, we are going to see how to Install and Use MySQL's new JSON datatype. Installing MySQL - JSON Plugin: 1. In order to use JSON datatype in MySQL, we need to have MySQL 5.7.12 or higher versions. Download the latest version of MySQL 5.7.12 or higher from here. 2. Installing the X Plugin A non-root user will have access to install the X Plugin on MySQL database, since he have to perform INSERT operations on the database. There are 3 types of Plugin installations available.  Using MySQL installer for Windows: Launch MySQL Installer for Windows. Click the Reconfigure option. Use Next and Back to configure for following actions: In Accounts and Roles , confirm the current root account password In Plugin and Extensions , check mark the Enable X Protocol/MySQL as a Document Store check box. In Apply Server Configuration , click

Unable to open the log file (mysqld)

While starting the server you may find the below errors sometimes, it's because of unintentionally deleting the MySQL Binary Log files. When starting mysql if the server unable to find the mysql-bin-log files then below errors will arise. 170418 12:15:19 InnoDB: 5.5.30 started; log sequence number 32347593422 /usr/sbin/mysqld: File './mysql-bin.000023' not found (Errcode: 2) 170418 12:15:19 [ERROR] Failed to open log (file './mysql-bin.000023', errno 2) 170418 12:15:19 [ERROR] Could not open log file 170418 12:15:19 [ERROR] Can't init tc log 170418 12:15:19 [ERROR] Aborting 170418 12:15:19 InnoDB: Starting shutdown... 170418 12:15:20 InnoDB: Shutdown completed; log sequence number 32347593422 170418 12:15:20 [Note] /usr/sbin/mysqld: Shutdown complete Do we have a solution to get rid of this and start MySQL again? Well, we have two types of workarounds to start MySQL again. 1. Deleting the missed files in binlog .index  file 2. Disabling the binlog log

Warning: Using a password on the command line interface can be insecure

We usually use MySQL login information on shell scripts to load some data into database or to fetch some monitoring information. To login to the database will write login information on Shell Scripts as below #!/bin/sh username = someusername password = somepassword $ mysql -u$username -p$password -A -v -S By doing that so, we will hit a warning in stdout saying: Warning: Using a password on the command line interface can be insecure To avoid the warning in shell script, we need to so some workaround like below: 1. Create a hidden file configuration file > touch /tmp/.mysqllogin.cnf 2. Enter your database credential information on the hidden file: > vi /tmp/.mysqllogin.cnf [client] user=someusername password=somepassword 3. Save the file and try to login to mysql using  --defaults-extra-file  keyword like $ mysql --defaults-extra-file=/tmp/.mysqllogin.cnf -A -v By using this workaround you can avoid the warning.

MySQL 5.7 Installation; Issues and Resolutions

Recently while installing Percona MySQL 5.7.17 in an Amazon EC2 instance identified couple of Errors. The resolutions are quite simple and easy. Will have a keen look into this by installing MySQL step by step: 1. Download Percona from the official website $ wget https://www.percona.com/downloads/Percona-Server-LATEST/Percona-Server-5.7.17-12/binary/tarball/Percona-Server-5.7.17-12-Linux.x86_64.ssl101.tar.gz 2. Untar/Unzip the Binaries $ tar -zxvf Percona-Server-5.7.17-12-Linux.x86_64.ssl101.tar.gz 3. After successful unzip of software, tried to install the default mysql database using mysql_insall_db command,. Note: From MySQL 5.7 mysql_install_db path has changed from scripts/mysql_install_db to bin/mysql_install_db After running the below command: $ bin/mysql_install_db --defaults-file=/etc/my.cnf --datadir=/data/mysql/data/ Got the below error [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize [ERROR] Child process:

What's new in MySQL 5.7

What's new in MySQL 5.7:          Configuration Changes          System Table Changes          Server Changes          InnoDB Changes          SQL Changes Configuration Changes: 1.      The information_schema has table’s that contains system and status variables (Global Variables and Session Variables). As of MySQL 5.7.6 the performance_schema also contains same tables, those are actually intended to replace in information_schema which are deprecated as of MySQL 5.7.6, and will be removed in future releases. 2.      As of MySQL 5.7.6 mysqld_safe is no longer installed on Linux systems on which MySQL installed using RPM packages, the server startup and shutdown will be managed by using the system d service. 3.      As of MySQL 5.7.6 and later mysql_install_db is moved from scripts folder to bin folder and scripts directory will no longer present. 4.      Strict SQL mode for transactional storage engine (InnoDB) – (STRICT_TRANS_TABLES) is enabl