MySQL Red hat linux

How to re-sync the Mysql DB if Master and slave have different database incase of Mysql replication?

This is the full step-by-step procedure to resync a master-slave replication from scratch: At the master: And copy the values of the result of the last command somewhere. Without closing the connection to the client (because it would release the read lock) issue the command to get a dump of the master: Now you can release the […]

MySQL Red hat linux

Upgrade MySQL to Version 5.6 in CentOS

Backup all the database and stop mysql

Download the Repo for MySql 5.6

Install the repository from the local file

Install the latest MySql

Configure MySQL to start automatically on Server Reboot

Need to apply some tweaks Its not like the previous versions that tweaks are not required. From Version […]

MySQL

Install and Configure MySQL Cluster on CentOS 7

MySQL Cluster is designed to provide a MySQL compatible database with high availability and low latency. The MySQL Cluster technology is implemented through the NDB (Network DataBase) and NDBCLUSTER storage engines and provides shared-nothing clustering and auto-sharding for MySQL database systems. In the shared-nothing architecture, each of nodes has its own memory and disk, the […]

MySQL Red hat linux

Password Validation Plugin in MySQL

The validate_password plugin serves to test passwords and improve security. The plugin exposes a set of system variables that enable you to define password policy. First check the plugin directory of MySQL.

Go to given path and check it. We can see lots of plugins are present in Plugin Directory Of MySQL. We need […]

MySQL

Purge binary logs in MySQL

Please do not just delete them in the OS. You need to let mysqld do that for you. Here is how mysqld manages it: The file mysql-bin.[index] keeps a list of all binary logs mysqld has generated and auto-rotated. The mechanisms for cleaning out the binlogs in conjunction with mysql-bin.[index] are:

These will clear […]

MySQL

MySQL Master-Master Replication Bug – ERROR 1872

Description: When i tried to configurate a crash safe slave with MTS and GTID based replication, but after a OS crash replication failed to be start.

And, “start slave” also failed

According the manual, When using GTIDs and MASTER_AUTO_POSITION “sync_relay_log=1” is not necessary. http://dev.mysql.com/doc/refman/5.6/en/replication-solutions-unexpected-slave-halt.html How to repeat: STEP1: run a script to execute […]

MySQL Red hat linux

MySQL Master-Master Replication

Create MySQL user

Drop Mysql User

Create Mysql Database and grant permission

View MySQL users

MySQL Master-Master Replication SERVER 01

SERVER 02

Set replication

log into mysql as root

MySQL Red hat linux

Password less command line scripts with MySQL 5.6

I have a number of command line scripts that copy MySQL databases down from staging servers and store them locally. These scripts set the password on the command line using the -p option. With MySQL 5.6, a new warning is displayed every time my scripts run:

This is annoying! The way to solve this […]

MySQL

How To Create a New User and Grant Permissions in MySQL

How to Create a New User Let’s start by making a new user within the MySQL shell:

Sadly, at this point newuser has no permissions to do anything with the databases. In fact, if newuser even tries to login (with the password, password), they will not be able to reach the MySQL shell. Therefore, […]