Cambiar Charset / Collation a tablas MySQL

No se porqué, pero Sequel Pro (Que es una excelente herramienta y recomiendo) no permite modificar el charset de una tabla una vez creada.

Sin embargo podemos hacerlo mediante una simple linea en la consola MySQL:

ALTER TABLE `mi_tabla`  DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

En este ejemplo estoy seteando un charset utf8 y collation utf8_general_ci para la tabla “mi_tabla”.

Para un listado completo de los charset/collations soportados por MySQL vean este articulo.

Posted: April 16th, 2008 | Author: lichi | Filed under: mysql | Tags: , , | No Comments »

Problemas con MySQL timestamp y VB.Net

Estuve a las vueltas a la hora de recuperar valores de un campo timestamp de una DB MySQL desde VB.Net.

En algunas ocasiones me devolvía este error: Unable to convert MySQL date/time value to System.DateTime.

El problema se da solo cuando nuestro registro no tiene valor para el campo timestamp. Es decir, su valor es: “0000-00-00″.

Para solucionar este pequeño inconveniente podemos hacer alguna de las siguientes modificaciones:

1) Setear un valor timestamp válido, a todos los registros cuyo timestamp no representa una fecha real.

o …

2) Agregar: Allow Zero Datetime=true al ConnectionString :


Dim strConnString As String

strConnString = "server=" & Settings.Default.host & "; " & _
"user id=" & Settings.Default.user & "; " & _
"password=" & Settings.Default.password & "; " & _
"database=" & Settings.Default.db & ";" & _
"Allow Zero Datetime=True;"
Posted: January 6th, 2006 | Author: lichi | Filed under: mysql, vb.net | Tags: , , | No Comments »