score:1
Accepted answer
I believe REPLACE
will work for you (replace
mysqldump option), since it behaves like this: If a row exists in the destination table that matches the row data in the REPLACE
statement (based on PRIMARY KEY
or UNIQUE KEY
value(s)), that data in that row is deleted and replaced with the data in the source (dump file) row. If there is no such match, the source row is inserted into the destination table.
More questions
- How can I make a MYSQL view update after a trigger causes an insert on table used in view
- Can I dynamically insert an array into mysql that I have generated from a regex match?
- How Can we monitor MYSQL DB table in realtime for any update and insert using PHP(Without cron) or any other scripting language?
- how can I have a date field in mysql that will be update auto by a server?
- MySQL UPDATE and INSERT both returning error message about bad syntax, but it is correct syntax when trying it on phpMyAdmin
- Mysql insert on duplicate key update and delete if key not exists
- How to insert data from 3 different input fields together in one column of table in mysql database in codeigniter
- Insert into mysql if postid is new, else update
- Based on the following MYSQL query how can I write an UPDATE statement to update a value?
- MySQL query - if not exists - insert into - else - update
- How do I add two mysql columns together and then update the result to one of the same columns?
- How to UPDATE MySQL Database if I have different ids?
- MySQL Can Only Insert 10,000 Rows
- mysql update and insert statements based on another table
- How to display results of a query (with subqueries) where one of the columns can have more than one info using mysql and php?
- MYSQL - insert into table or update if anything is different
- MySQL INSERT query returns "You have an error in your SQL syntax" error
- how can i update in mysql using 2 condition in where
- How do I update a MySQL entry if I have a duplicate of the 'WHERE' fields?
- MySQL insert and update triggers
- Insert or Update depending on some condition in MySQL
- Update MySQL table after INSERT
- How can i join this 2 MySQL queries together
- How can I get MySQL records from past 7 days, but only days that have a record, and return each day as a record?
- How can I write a MySQL query where two tables have conditions?
- how can I update a mysql record using a form with mutliple inputs but only update the inputs with values entered
- mysql insert and update on duplicate
- How can I verify a MySQL import of a database that was previously exported?
- mysql column for insert and different one for update
- How can I perform many-to-many insert using MySQL an PHP?
More questions with similar tag
- How to merge column data using the last updated value in MySQL?
- Laravel + MySQL + SSL-Mode - SQLSTATE[HY000] [3159]
- SQL using N-1 Dense Rank to filter out rows in dense rank N Mysql
- I want to upload some data to my database but the method returns me null
- Order by future event of a project ASC, followed by past events DESC
- PHP undefined offset when running SQL Query
- MYSQL join two tables but fill table1 with table2 values
- Get mysql values from cell X by comparing information in cell Y and cell Z?
- Preventing UUID collision
- SELECT COUNT with date and type
- SELECT list is not in GROUP BY clause and contains nonaggregated column … incompatible with sql_mode=only_full_group_by
- Microsoft SQL how to construct the table from the rows
- SQL copy data from one column to another
- sQl buddy: you have an error in your SQL syntax;
- SQL How to group different values in a table?
- how to store images on server so that image path with id can be store in a property file as map so that we can get images based on id
- How to get name, quantity of product and balance amount?
- POST javascript into mysql database
- How to restore dump without drop table before in MySql
- Remove CSV formula values during mysql load data infile import
- How to make the connection between the mysql database and springboot application
- Filtering by 2 separate condiitions in mysql
- MySQL connection refused "ERRNO 111" using Python mysql.connection library
- CodeIgniter 3 :- Unable to connect to your database server using the provided settings
- read dates from a text file and convert - what kind of datamodel?
- Convert a value(string) to timestamp (Input string has unwanted characters) - SQL
- Is there a way in MySQL to have one column be just a reference to another column on the same table?
- codeigniter 4 not showing mysql full query when error occured
- Selecting categories and articles
- How to join three different tables in mysql with no common field amongst them all
Source:
stackoverflow.com