[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] cargar archivo txt a MySQL por bash



El 23/03/07, user name <someusernamehere@gmail.com> escribió:


On 3/23/07, Gonzalo Rivero <fishfromsalta@gmail.com> wrote:
> el nombre del archivo (en este caso: prueba.txt) debe ser el nombre de
> la tabla. Así que, si ya tenés una tabla prueba, tendría que funcionar
>
>


 ahhh orales, eso era lo que no sabía, que debía llamarse igual que la tabla
:D muchas gracias!!!

yo ya había dicho eso:
El 22/03/07, Gonzalo Rivero <fishfromsalta@gmail.com> escribió:
el mysql import es cuando solo tenés los datos en csv. El nombre del

              ^^^^^^^^^^^^^^
archivo debe ser el de la tabla donde van a ir a dar esos datos.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  aquí está ;)

Si tu archivo son sentencias sql podes hacer
mysql -u usuario -p prueba < /home/panchito/pruebas/prueba.txt

El manual tambien lo dice:
man mysqlimport
NAME

mysqlimport - Imports text files with MySQL database queries.
SYNOPSIS

mysqlimport [options]
DESCRIPTION

Loads tables from text files in various formats. The base name of the
text file must be the name of the table that should be used. If one
uses sockets to connect to the MySQL server, the server will open and
read the text file directly. In other cases the client will open the
text file. The SQL command 'LOAD DATA INFILE' is used to import the
rows.

For more information start the program with '--help'.

--
<`>
http://fishblues.blogspot.com/
http://gonzalor.blogspot.com/

Reply to: