Cambiar el juego de caracteres de MySQL

07/07/2009
By

Simpre podemos compilar con la opcion:

./configure --with-charset=utf8 --with-collation=utf8_general_ci

O cambiar la fomra que el servicio mysqld inicia, tecleamos como root:

mysqld --character-set-server=utf8 --collation-server=utf8_general_ci

O simplemente convertimos la base de datos, desde la consola de mysql:

ALTER DATABASE `myDB` CHRACTER SET utf8 COLLATE utf8_general_ci; // run the following query on each table: ALTER TABLE `tableName` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
/etc/php.ini

Ahora actualizamos los valores por defecto de php:

; PHP's built-in default is text/html
default_mimetype = "text/html"
;default_charset = "iso-8859-1"
default_charset = "utf8_unicode_ci"

Popularity: 1% [?]


Otros articulos de interes:

  1. Convertir de latin1 a UTF-8 en MySQL
  2. MySQL: Error La tabla esta llena – resuelto
  3. ERROR 2002: Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
  4. MySQL Recuperar la contraseña de root en 5 pasos
  5. Entidades HTML de los caracteres ISO 8859-1

Tags: character set, collation, mysqld, utf8

Leave a Reply

Your email address will not be published. Required fields are marked *

*