I have a MySQL database which I want to duplicate using the Ubuntu Linux CLI without first having to download a MySQL file. I tried the following command: mysql -uroot -e’mysqldump -uroot db_old | mysql -uroot backup db_new;’ But got this error: ERROR 1064 (42000) at line 1: You have an error in y…
Tag: database
Commit data in a mysql container
I created a mysql container using the officially supported mysql image. I ran the image mounting a folder that contains a sql dump, then I created a new database in the container and imported the .sql dump in it: Then I listed the running containers to get that container’s id: Then, I commited the conta…
PostgreSQL CSV import from command line
I’ve been using the psql Postgres terminal to import CSV files into tables using the following which works fine except that I have to be logged into the psql terminal to run it. I would like to know if anyone knows of a way to do a command similar to this from the Linux shell command line similar to how
Alternative to writing many files. MongoDB?
I have a Perl script that produces ~10000 files in the 1kB – 10kB size area, which is not optimal for performance, so I though about using MongoDB instead of writing the many files. I need to run the script on my laptops Linux and OSX. Question Would MongoDB be overkill? Or are there something more suit…
Interacting with a .db file from Linux shell
I recently installed minidlna, a lightweight UPnP server, on my Raspberry Pi. Since this lacks the web interface of other programs such as Mediatomb, I thought it could be an interesting project for me to write one. I believe minidlna stores library information in a single file named “files.db”. E…
Why is this MYSQL statement giving me an error?
The file is there. I even pasted the path into the mysql console. The permissions are correct. In fact, I even tested it on root user and root mysql. Answer Note that when you do LOAD DATA INFILE, MySQL is looking for that file on the server – not on your client machine. If you want to use LOAD DATA
Postgres pg_dump dumps database in a different order every time
I am writing a PHP script (which also uses linux bash commands) which will run through test cases by doing the following: I am using a PostgreSQL database (8.4.2)… 1.) Create a DB 2.) Modify the DB 3.) Store a database dump of the DB (pg_dump) 4.) Do regression testing by doing steps 1.) and 2.), and th…