zmena kodovani mysql

Pavel Benisek pavel.benisek na 3dgrafika.cz
Neděle Květen 2 14:33:05 CEST 2004


Dekuji vsem za odpovedi.
Posilam postup, ktery mi zda se funguje.

1/ dump zadane databaze

bash-2.05b$ mysqldump -uroot -p dbname>~/dbname.sql

2/ Vytvoreni kopie databaze

bash-2.05b$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 87 to server version: 4.0.18
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database dbname_zaloha;
Query OK, 1 row affected (0.04 sec)
mysql>quit;
Bye
bash-2.05b$ mysql -uroot -p dbname_zaloha<~/dbname.sql
Enter password:
bash-2.05b$

3/ prekodovani dumpu

$ recode windows-1250..UTF-8 ~/dbname.sql

4/ Vymaz puvodnich dat a import novych

bash-2.05b$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 101 to server version: 4.0.18
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> drop database dbname;
Query OK, 0 rows affected (0.02 sec)
mysql> create database dbname;
Query OK, 1 row affected (0.00 sec)
mysql> quit
Bye

bash-2.05b$ mysql -uroot -p dbname<~/dbname.sql
Enter password:
bash-2.05b$

5/ zmenu hlavicek html jsem provedl v editoru Quanta plus volbou v menu 
Edit / Find in Files ... a naslednym nahrazeni radku:
<meta content="text/html; Charset=Windows-1250" 
http-equiv="Content-type">
za radek:
<meta content="text/html; Charset=UTF-8" http-equiv="Content-type">

6/ Odzkouseni

.. a heureka funguje to ;)

Pokud jde o blob objekty, tak ty v db nemam, ale predpokladam ze by 
stacilo je naimportovat do cilove db ze zdrojove az po konverzi...

Pekny den

Pavel Benisek



Další informace o konferenci Linux