Hi I need to copy data from a csv file into a mysql table.Copy of data has to be remotely.My csv file is not present on the db server.Any idea how to do it.
I can do locally file copy from csv but not from different machine.
thanks
you have many options. If you have phpMyAdmin or other sql manager - it is easier variant. Else you should copy the file locally and use mysql shell tools to import the data.
Take a look at LOAD DATA . By using the LOCAL option, you specify that it's a local file and not a file located on the db server. The FIELDS TERMINATD BY and other options lets you adjust to the format of your .csv file
Related
I have gone through a data migration and previous data is stored in MS-Access DB so the database has file attachment field,, here is the problem that i want to extract attached file or image to file directory.
OR if its possible for conversion to MySQL database.
Any Solution ???
I have found the solution to load xml file data to mysql db table Here
My question is how I can load remote location xml file and dump it to mysql database table.
If you have any idea or have done something like this please help to find the solution.
Thank you
LOAD XML statement does not support retrieving files from a remote location. The file has to be either on the server, or on the client (LOCAL - if enabled in configuration). You need to write a script that saves the file either to the server or to the client from the remote location.
If you manage to map a remote shared directory to the local fileszstem, then you can import data that way.
i want to convert a bak file of sql server into .sql/.csv/.xml file for mysql database.
And then i need a script that will automatically pick the file from server drive(suppose file is in D drive in mycomputer and script will automatically pick file from D drive) and execute sql/csv file to restore into my sql database(online) .
Actually i have two system, 1- is on VB that runs on local host and generates a bakup file daily
in the system and now i am going to create a new web application for same system that runs on VB.
i want that in my web application i write a script that will pick and backup file and ist convert into mysql supoported format(sql/csv/xml)(if necessary) and then execute that file for updating into mysql online database.
ANy kind of help will be highly appericiated.
many thanx in advance.
Possible by using MySql Migration Tool kit.
First install the software ,follow below steps
Huge mysql noob. Sorry in advance if this is dumb but I have searched around before posting.
I use mysqlimport on a local file to a mysql database that's running on my computer. If I delete the original file that was imported, can I still access the data? If so, where is the data being stored? On some Oracle server?
If it's stored locally, is it stored in a compressed version that takes up less space on my harddrive?
Thanks,
fertileneutrino
if you import a file to a database, it is going to store an instance of that data in the database, so yes, you should still be able to access the data, but why would you want to delete it?
It is being stored in a pool of database files in mySQL, they are referenced when you start mysql...yes the imported doc, is just a .dat file in most cases, as your database file.
When you import the data it is stored in database files on your local machine, using the mysql client program or something like phpmyadmin you should be able to view your imported data.
It's no longer stored in the same format as it was when you first imported it.
you can use something like mysqldump to get the data back out.
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
I deleted my database and customer service sent me back a .dat file but their instructions what to do with it were bad.
They said to put the (db_backup.dat) file in mysql/data folder and then do an export to sql to restore data. Can anyone help out here how to do this the file is not a text file with sql commands in it just lots of things that are not readable.
I'm assuming the .dat file is a text file.
mysql -u root -p password < db_backup.dat
Looks like they could've sent you bare data file, which you should put into mysql folder and restart mysql server.
In case they sent you bare DB file, you should ask customer service which format is that. It could be a MyISAM or InnoDB file. In case they tell you format you should crate a new database of that format titled db_backup, then find where you mySQL instance keep files, stop server, put the file you get from CS into that folder, replacing existing one and start server again.
Finally, can you post few first lines of the file or screenshot from Notepad++ ?
P.S. All above are guesses until you post head of the file or which format it is.