Row cannot be located for updating mysql server
as opposed to creating a user here with what would be a conflicting username.This is, of course, one of the tradeoff decisions you'll need to make.Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Sign up to join this community I am creating a trigger in My SQL and I need a little help.If a user registration information is updated on S1, the same information should be updated on S2. How can I create a trigger so that every time there is an insert / update / delete in database on S1, then the user table on S2 also gets automatically updated. storage engine on both servers, in conjunction with triggers, to allow each server to update the other server's database.And every time there is an insert / update / delete in database on S2, then the user table on S1 also get automatically updated. This is not exactly a simple out-of-the-box solution, because it requires additional precautions and requires you to decide whether consistency or isolation tolerance is more important and allow the queries to fail when the other server isn't available (more consistency) or use a CREATE TABLE remote_user ( username varchar(64) NOT NULL, password varbinary(48) NOT NULL, /* encrypted of course */ PRIMARY KEY(username) ) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://username:[email protected]_other_host:port/schema/user'; Selecting from remote_user on one server will retrieve the records from the other server, and insert/update/delete on that table will change data on the other server.SELECT [ ALL | DISTINCT | DISTINCTROW ] [ HIGH_PRIORITY ] [ STRAIGHT_JOIN ] [ SQL_SMALL_RESULT | SQL_BIG_RESULT ] [ SQL_BUFFER_RESULT ] [ SQL_CACHE | SQL_NO_CACHE ] [ SQL_CALC_FOUND_ROWS ] expressions FROM tables [WHERE conditions] [GROUP BY expressions] [HAVING condition] [ORDER BY expression [ ASC | DESC [LIMIT [offset_value] number_rows | LIMIT number_rows OFFSET offset_value] [PROCEDURE procedure_name] [INTO [ OUTFILE 'file_name' options | DUMPFILE 'file_name' | @variable1, @variable2, ...||
as opposed to creating a user here with what would be a conflicting username.]]
They are written as triggers, with the idea being that we don't want to do something to ourselves that we can't do to the other server -- for example, if a username already exists on the other server, but not here, we want the insert on the other server to throw an error that prevents us from creating the user here...
, is by far the simplest technique you can use to increase the performance and the reliability of your My SQL server installation.
If you don’t know what it is, just imagine two My SQL server instances continuosly updating each other in real-time while fullfilling their job.
We’ll be calling them Server A and Server B from now on.
The first thing you need to do is to install My SQL on Server A and Server B.