Re: Question about dump on MySQL

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



On Tuesday 12 August 2014 08:15:16 Alan McRae wrote:
> echo "select * from users where id=20;" | mysql -u user -ppass -Ddb
> 
> Alan McRae
> 
> On 12/08/2014 08:10, Rodrigo Pichiñual Norin wrote:
> > I need export an registers of a data base from command line.
> > 
> > It is possible with mysqldump?
> > 
> > for example:
> > 
> > mysqldump -u user -ppass db "select *from users where id=20" ???
> > 
> > 
> > thank
> > _______________________________________________
> > CentOS mailing list
> > CentOS@xxxxxxxxxx
> > http://lists.centos.org/mailman/listinfo/centos
> 
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos

No need for the pipe:

mysql -u user -p $DATABASE -e "select * from users where id=20"

NOTE: I did *not* type the password, the very fact that you can actually type 
the password in the command should be abolished from mysql cli

Regards
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos





[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux