[R-es] Aprendiendo RMySQL

Xavi de Blas xaviblas en gmail.com
Sab Mayo 8 04:01:38 CEST 2010


Hola Kjetil

No tengo experiencia con RMySQL pero sí que uso RSQLite. Si nunca has
usado una base de datos, Sqlite te será más sencillo de conectar
porque no hay configuraciones de permisos, grant, ...

Este es un ejemplo de uso de RSQLite:

library(RSQLite)
drv = dbDriver("SQLite")
file = "ruta-completa-al-archivo.db"
con = dbConnect(drv, file)

datos <- dbGetQuery(con, "SELECT ...")

Por otro lado, deberás estudiar SQL porque si no lo haces, no serás
nada productivo. A mi siempre me ha gustado el primer capítulo del
libro MySQL de Paul Dubois.

@BOOK{Dubois2001,
  title = {Edición especial MySQL},
  publisher = {Pearson Educación, S.A.},
  year = {2001},
  author = {Dubois, P},
  address = {Madrid},
}

Saludos


2010/5/8 Kjetil Halvorsen <kjetil1001 en gmail.com>:
> fue mandado por error antes de terminar .... continuando abajo
>
> 2010/5/7 Kjetil Halvorsen <kjetil1001 en gmail.com>
>
>> Hola!
>>
>> Estoy tratando de aprender como usar un base de datos con R. Nunca he usado
>> un base de
>> datos antes. Trato con RMySQL, todo instalado en ubuntu linux 10.04.
>>
>> library(RMySQL)
>> myBase <- dbDriver("MySQL")
>>
>>  con <- dbConnect(myBase)
>> Error in mysqlNewConnection(drv, ...) :
>>   RS-DBI driver: (Failed to connect to database: Error: Access denied for
>> user 'kjetil'@'localhost' (using password: NO)
>> )
>>
>>
>> Que debo hacer? Es necesario iniciar MySQL antes, afuera de R?
>>
>> Mi intención por el momento simplemente es iniciar un base nuevo, llenarlo
>> con algunos
>>
> datos de un data.frame, almacenarlo, t talvez tratar de accederlo desde
> afuera de R como un control.
>
> Kjetil
>
>> --
>> The good Christian should beware of mathematicians, and all those who make
>> empty prophecies.
>> The danger already exists that the mathematicians have made a covenant with
>> the devil to darken
>> the spirit and to confine man in the bonds of Hell.
>>
>> St. Augustine, De Genesi ad Litteram, Book II, xviii, 37
>>
>>
>>
>>
>
>
> --
> The good Christian should beware of mathematicians, and all those who make
> empty prophecies. The danger already exists that the mathematicians have
> made a covenant with the devil to darken the spirit and to confine man in
> the bonds of Hell.
>
> St. Augustine, De Genesi ad Litteram, Book II, xviii, 37
>
>        [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-help-es mailing list
> R-help-es en r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>
>



Más información sobre la lista de distribución R-help-es