mysql - where to save file when trying to load into database -
I am working with the database, and I want to play with the ability to load the file contents in a table . I am currently using a host server for a website, and using phpmyadmin to interact with mysql. My question is, if you are not using a local host, how can you save the file that you want to load? Everything I read with local hosting, but what if I have a file that I have saved on an external server? I thought 'table name [name of the table] will work to do anything like' code LOAD DATA INFILE 'URL, but instead I get an error.
Do I need to save it locally to my computer and then somehow read the file from the local route? I'm not sure this is done normally.
option 1
If you have SSH access to a MySQL server machine, in the machine SSH Log in and
-
MySQL Client to
- local-infile = 1
mysql --local-infile = 1 -U Username-P yourdb
Load the file (assuming it's in your current directory) in the table
< Code> Load data local INFILE 'namelist.csv' defined in table customer column ','; Create a database example in the local machine MySQL server
- Load the data shown in Option # 1
mysqldump -u username -p yourdb importedtbl & gt; Tbldump.sql
- If your remote webserver is phpMyAdmin to connect to your remote database server, then use it to import the table dump on your remote server.
Comments
Post a Comment