mysqldump

Merging tables in MySQL - sum up columns

I have an interesting problem, that i am sure has a simple answer, but i can't seem to find it in the docs. I have two separate database tables, on different servers. They are both identical table schema with the same primary keys. I want to merge the tables together on one server. But, if the row on Server1.Table1 exists in Server2....

mysql Dump does not write complete data into files

I have a program in which I use mysqldump on selected tables, the utility runs fine but at times the dump is not complete, i.e there are thousands of rows that exist in the original db and not in the dump file, can anyone help ? ...

how to get insert sql in mysql shell or java library?

my table is: [tableAbc] A B C ------------ 1 a b 2 c e 3 e r ... run: show create table tableAbc; to get the create table sql but how to get insert sql? like: insert into `tableAbc` ('A','B','C') VALUES(1,'a','b'); ... any idea? (or any java library to do this) thanks all! BTW: i want show the "insert sql" to web brower. so...

Is it posible to dump a MySQL Database into a seed.rb file?

I have a rails app with a heavy initial data in the database. Everytime I use rake db:reset I must import a sql file for loading this data. That is not kinda rails way, so I whis I could get this data into a seed.rb and deploy it with the app. ...

Dump tables from database in mysql?

How can I dump each table in database in separate file with that table name? ...

Write mysql blob object in a sql file as BackUp.

I am using PHP and mysql. I am logging mysql query with data in a separate file which extension is sql. (filename.sql). Purpose is I can use this sql log file as backup file. Logging varchar,int values with query is working fine. SQL log file looks as sql backup file which is created by mysqldump hence I can use sql log file as SQL scri...

mysql_stmt_reset function fail

Hi Guys,I use mysql's lib to make a small sql program,when i use mysql_stmt_prepare,then mysql_stmt_reset to excute the query,it always return 1,the error msg is CR_SERVER_LOST,is some one have the same question?Help me Plz:D ...

Error inserting data into mysql

I am trying to insert data from a csv file into mysql using BigDump. It stops on line 2, with the error: "Query: INSERT INTO location VALUES (1,"O1","","","",0.0000,0.0000,, ); MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '...

MySQL dump file and commented out lines

I have these lines at the top of a MySQL .sql file (dumped with phpMyAdmin): /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; But they all seem to be comment...

add mysqldump to MAMP (MySQL /w Apache PHP on MacOS X)

Hi all, I wonder how I can add mysqldump to my MAMP environment. I googled a bit and found only the community MySQL server version. But I do not want to install another MySQL – basically because I want to save my data first, before any experiment. thx for help in advance (probably it´s just a simple link :) ...

Aggregating multiple distributed MySQL databases

I have a project that requires us to maintain several MySQL databases on multiple computers. They will have identical schemas. Periodically, each of those databases must send their contents to a master server, which will aggregate all of the incoming data. The contents should be dumped to a file that can be carried via flash drive to ...

How to restore data from MYSQL dump without any duplicate key errors?

Everytime I try restoring the dump, I get : ERROR 1062 (23000) at line 10297: Duplicate entry 'spaß' for key 'PRIMARY' I am trying to restore it using: mysql -u root -ppassword database < 0719.sql ...

How to use mysql dump in php

I've tried using mysql dump in the command line and it worked. How do I do it in php? I found this code from the internet, and tried it. <?php ob_start(); $username = "root"; $password = "mypassword"; $hostname = "localhost"; $sConnString = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $conn...

mysql dump generating a blank sql file

Please help, I got this code from googling on how to use mysql dump on php. But its just generating a blank .sql file. I already tried putting the mysqldump.exe on the same directory as the php file but doesn't work. <?php system('mysqldump -uroot -pmypassword test > C:\wamp\www\test\test.sql'); ?> I'm trying to do this, but I am run...

Restore of MySQL Backup just stuck

I have a with mysqldumb created backup file. It's about 15GB and contains a lot of blobs. Max size per blob is 30MB. mysqldump -uuser -ppass --compress --quick --skip-opt supertext > supertext.sql Now when I try to restore the backup, the process just gets stuck. mysql -uuser -ppass dev_supertext < supertext.sql It get stuck w...

mysql dump selection of databases (not sure how many)

I would like to create a backup script (.sh that I can cron) that backs up the following databases: someotherdatabase database1 database2 database3 database4 database5 database6 ... database9999 I know "someotherdatabase" will always have that name so that can be backed up easily. The other databases have an incremental number but I d...

Is there a convenient way to include a mysqldump in my git commits?

Especially if I'm using GitHub? If not, should I (or perhaps someone else) work on such a tool? ...

how to backup all DB info using mysqldump?

I want not only the "Create table" statements, but also the Inserts. What flags should i pass to mysqldump? In addition - the database is relatively large (2-2.5G). Obviously, i want the backup to be as fast as possible. Any flags that might help? Thanks ...

a bash script to dump a database

how to write a bash script which will dump a database and restore it. there should be two arguments. first one is the name of db which is going to be dumped and another one is name of the db in which i am going to restore the previously dump data. ...

mysql rbar situation

What would be the best way to handle this situation? I'm working on off the shelf software, and it is storing user defined field names in the database as a row instead of adding a new column to the table. It looks like this: ID fieldName fieldValue propertyId 1 latitude 23.192 id_property1 2 longitude -10.323 id_p...