Posts

How to fix “error no 1062” in MySQL servers

 Last_Errno: 1062                    Last_Error: Error 'Duplicate entry '1246' for key 'PRIMARY'' on query. Default database: 'mamc'. Query: 'INSERT INTO transque (clipid, ext, sourcedeviceid, destinationdeviceid, requesttime, userid, sourcedir,exitcode, destinationdir, userremarks)                                                          VALUES ('ZWB81670', '.mxf', '229', '158', NOW(), '35', '\\\\172.18.1.10\\mg1\\SONY-CONTENT\\HD\\PROMOS\\MAX\\INDIA\\15-05-20\\File 2','MANUAL', '\\\\172.17.1.196\\Fc Server\\15-05-20', '')' How to delete the row First delete the row using the primary key. delete from  table1  where  field1  is  key1 ; Then stop and start the slave: stop slave; start slave; select sleep(5); Once it is done, check the slave status to ...

HOW TO SETUP GTID MASTER SLAVE REPLICATION MYSQL 5.7

A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (master). This identifier is unique not only to the server on which it originated, but is unique across all servers in a given replication setup. There is a 1-to-1 mapping between all transactions and all GTIDs. A GTID is represented as a pair of coordinates, separated by a colon character (:), as shown here: GTID = source_id:transaction_idMySQL_gtid-master-slave Advantages : ● Setting up MySQL replication is simple ● Consistency is guaranteed between master and slaves. ● Simple to determine inconsistency ● Fail-over process become much easier. step.1. stop the both master and slave servers. systemctl stop mysqld step.2. configure the master server. To enable GTID-based replication, each server must be started with GTID mode enabled by setting the gtid_mode variable to ON, and with the enforce_gtid_consistency variable enabled to ...

Recover MySQL 5.7 root Password in Redhat/CentOS 7

step.1. stop mysqld service systemctl stop mysqld  step.2.set the mysql enviroment option systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" step.3 start mysqld service using the option just you set systemctl start mysqld step .4. login as root mysql -u root  step.5.update the root user password using this command mysql> UPDATE mysql.user SET authentication_string = PASSWORD('YourNewPassword') -> WHERE User = 'root' AND Host = 'localhost'; mysql> FLUSH PRIVILEGES; mysql> quit step.6.stop mysqld systemctl stop mysqld step.7. unset the mysql enviroment variable  systemctl unset-environment MYSQLD_OPTS step.8.start mysqld service normally systemctl start mysqld step.9. mysql -u root -p

TABLE OPERSTION IN ORACLE DATABASE

TABLE OPERTION---ALTERING STRUCTURE ·          Introduction ·          Renaming a table ·          Adding column to a table ·          Removing column from a table. ·          Increasing width of a columns. ·          Decreasing width a columns. ·          Changing data types of a columns. ·          Copying of a table. Introduction:- Let us turn our focus on modifying the existing structure of table. By structure we means column names, data types and constrains. Renaming a table:- Now change the table name COLLAGE TO COLLAGES. SQL> select * from collage; COLLAGE           ...