Showing entries 6751 to 6760 of 44037
« 10 Newer Entries | 10 Older Entries »
Know about MySQL BINLOG FORMATS


What is binlog?


In MySQL the binary log record the events that, when ever the changes happens in the databases. (eg.create,delete,update,insert)

   What is binlog formats?


The format that has been used to record the changes of data in binlog.


What are the their types?


There are three types of binlog formats.


1) Statement

2) Row

3) Mixed

1) Statement 


It is the default binlog format for MySQL5.6. It records the events in SQL statement in binlog to read easily with mysqlbinlog. The binlog does not grow so fast than row format.
Faster to recover from a backup.  how it works?
· set the binlog format to statement if you use older version of MySQL 5.6 in my.cnf file.

 · restart MySQL   · create a database example india. …

[Read more]
Detailed information about Storage Engines in MySQL

MySQL STORAGE ENGINES


What is storage engine?

       In MySQL the datas are stored as files in any one of the types in storage engines. MySQL supports pluggable storage engines that we can use any types of engine belongs to your data.There are two types of storage engines in MySQL  Transactional(The data can be modified in engines) and non-transactional(It can only fetch the data from engines). The default storage engine for MySQL prior to version 5.5 was MyISAM. For MySQL 5.5 and later, the default storage engine is InnoDB.


Types of Storage Engine


1.MyISAM

2.InnoDB

3.Merge

4.Memory

5.Blackhole

6.Archive

7.CSV

8.Federated


1.MyISAM


       MyISAM is the oldest storage …

[Read more]
MySQL version poll: a not so scientific analysis

Prior to my talk at LaraconEU 2016 I was curious to know how much adoption for MySQL 5.7 was in within the community.

I tweeted this:

Pool, use twitter client to see it:

Which Version of MySQL do you use? SELECT @VERSION; RT for reach, please.


Gabriela D'Ávila (@gabidavila) August 23, 2016

Twitter polls only gives you up to 4 items to choose. What I wanted to know is if people were using MariaDB or other forks like Percona, but I didn’t had the proper space, and I  only put three options.

This January I managed to get a bit more syndication on my tweet and more people replied. I added a 4th option, “Other”. This option could …

[Read more]
Using NVMe Command Line Tools to Check NVMe Flash Health

In this blog post, I’ll look at the types of NVMe flash health information you can get from using the NVMe command line tools.

Checking SATA-based drive health is easy. Whether it’s an SSD or older spinning drive, you can use the

smartctl

 command to get a wealth of information about the device’s performance and health. As an example:

root@blinky:/var/lib/mysql# smartctl -A /dev/sda
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-62-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
 1 Raw_Read_Error_Rate     0x002f   100   100   000 …
[Read more]
Treating NULLs as not less than zero in ORDER BY

I was working on a seemingly basic query the other day where the user needed to have an INT column listed in ascending order (i.e., 1, 2, 3, …).

However, the tricky part came in because the column allowed NULLs and the user needed the NULLs to be listed last, not first, which is the default behavior in both MariaDB and MySQL.

We first devised a somewhat convoluted solution where we used ISNULL() first in the ORDER BY, and then the column, but that wasn’t ideal since it added an additional check for each row in the ORDER BY, which we wanted to avoid in a query returning ~5M rows.

To illustrate, a normal query just sorting in ASC order returned:

MariaDB> SELECT * FROM t1 ORDER BY col1 ASC, col3 ASC;
+--------+--------+------+
| col1   | col2   | col3 |
+--------+--------+------+
| apple  | yellow | NULL |
| apple  | red    |    5 |
| apple  | green  |   10 |
| banana | brown  | NULL |
| banana | green  |    5 |
| …
[Read more]
How to deploy and manage MySQL multi-master replication setups with ClusterControl 1.4

MySQL replication setups can take different shapes. The main topology is probably a simple master-slave setup. But it is also possible to construct more elaborate setups with multiple masters and chained setups. ClusterControl 1.4 takes advantage of this flexibility and gives you possibility to deploy multimaster setups. In this blog post, we will look at a couple of different setups and how they would be used in real-life situations.

New Deployment Wizard

First of all, let’s take a look at the new deployment wizard in ClusterControl 1.4. It starts with SSH configuration: user, path to ssh key and whether you use sudo or not.

Next, we pick a vendor and version, data directory, port, configuration template, password for root user and, finally, from which repository ClusterControl should install the software.

Then, the third and final step to define the topology.

Let’s go through some of these topologies …

[Read more]
How to run integration tests at warp speed using Docker and tmpfs

Introduction As previously explained, you can run database integration tests 20 times faster! The trick is to map the data directory in memory, and my previous article showed you what changes you need to do when you have a PostgreSQL or MySQL instance on your machine. In this post, I’m going to expand the original … Continue reading How to run integration tests at warp speed using Docker and tmpfs →

Downgrading MySQL Database version from 5.5.28 to 5.5.25a


Find Table Size :
mysql> SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES               WHERE TABLE_SCHEMA = 'mrsqa4'; +-----------------+ | SUM(TABLE_ROWS) | +-----------------+ |           10655 | +-----------------+ 1 row in set (0.29 sec)
 pc_auditlog               |          1 | | pc_dbobject               |        475 | | pc_dbrconfig              |          2 | | pc_iclass_sig             |       1660 | | pc_namespace              |          8 | | pc_namespace_sequence     |          0 | | pc_ormstate           …

[Read more]
Capturing MySQL Queries

               Capturing MySQL Queries


I know there is mytop, mtop, and innodbtop out there, just google them, but it can be very hard to Freeze The Frame to get every query.  So, here’s a quick and dirty script to catch the queries and see what you users are doing.



#!/bin/sh #./run_show_full_processlist.ksh > SHOW_PROCCESSLIST.doc &

x=1

while [ $x -le 3600 ]                      #Loop for 1 Hour (60sec * 60 = 3600)

do

echo "START TIME"

date

echo "show full processlist;" | mysql –h HOSTNAME -uUSERNAME -pPASSWD

  x=$(( $x + 1 ))

echo "END DATE"

date

sleep …

[Read more]
Display All CPU in MySQL


Display All CPU(s) With the top Command


As you know, the top command displays All CPU(s) so it is difficult to identify if All CPU(s) are pegged.  Interactively, you can toggle top by pressing the Number 1 on the keyboard, however that toggle cannot be scripted.


The work around is to create a .toprc file in your home directory by pressing the W key (capital W) while top is running.  If you are paying attention, you will see a message that the .toprc file was just created.  From there on out, typing top will display All CPU(s).


Below is a script I run to capture top activity during peak loads.  Make sure you have enough disk space!


vi run_top.sh

#!/bin/sh

#Syntax Below

#./run_top.sh > TOP_UNDER_LOAD.doc

x=1

while [ $x -le 4000 ]        #Run 4000 Times

[Read more]
Showing entries 6751 to 6760 of 44037
« 10 Newer Entries | 10 Older Entries »