[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, Santiago José López Borrazás <sjlopezb@hackindex.com> escribió:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

El 23/03/07 19:49, user name escribió:
> # mysql -uroot < prueba.txt
> ERROR 1064 (42000) at line 1: 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
> 'carnedepuerco,kilo,7.89,8.90,-1.01,-21.25,-12.80' at line 1

No es así. Es de esta manera:

mysql -u root < prueba.txt

Funciona de verdad.

pero para que funcione eso, el txt tendría que tener algo como:
USE prueba
INSERT INTO prueba VALUES ('carnedepuerco,kilo,7.89,8.90,-1.01,-21.25,-12.80');

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

Reply to: