การกำหนดให้ MySQL ใช้ utf-8 เป็นค่า default สามารถทำได้โดยการแก้ไข /etc/my.cnf ดังนี้
[client] default-character-set=utf8 [mysql] default-character-set=utf8 [mysqld] default-character-set = utf8 collation-server = utf8_unicode_ci init-connect=’SET NAMES utf8′ character-set-server = utf8
วิธีการง่ายๆ ในการย้ายข้อมูลระหว่าง database สามารถทำได้ดังนี้
สร้างฐานข้อมูลใหม่ เช่น new_database ใช้คำสั่ง mysqldump ดังนี้
#mysqldump -uroot -p old_database | mysql -uroot -p -D new_database
หลังจากทำการ upgrade MySQL server ควรจะใช้คำสั่งต่อไปนี้
#mysql_upgrade -uroot -p
และ
#mysqlcheck -uadmin -p –auto-repair –check –optimize –all-databases
เพื่อตรวจสอบว่ามีปัญหาระหว่างการ upgrade หรือไม่ เนื่องจากผมเจอปัญหาที่ดูเหมือนว่าฐานข้อมูลหายไป เมื่อตรวจสอบแล้วก็พบว่าฐานข้อมูลยังอยู่ แต่ถูกเติมข้างหน้าด้วย #mysql50#
If you have databases or tables from a version of MySQL older than 5.1.6 that contain special characters and for which the underlying directory names or file names have not [...]
ผมใช้ innoDB ใน MySQL แล้วเจอข้อความ error นี้
Lock wait timeout exceeded; try restarting transaction
วิธีแก้ปัญหาที่ทำตอนนี้คือเปลี่ยนกลับไปใช้ MyISAM เหมือนเดิมก่อน
ในกรณีที่ต้องการกำหนดค่า auto increment ใหม่ สามารถทำได้ตามรายละเอีดข้างล่างนี้
I have a database table with a auto increment column for primary key. As the records being add and delete many times, the auto increment value will keep increasing.
Problem One:
If I have entered 10 records, and deleted 9th, 10th records. The next auto increment value will [...]
Tags
.htaccess Apache blogspot CentOS codeigniter CSS domain name driver Drupal Flickr Hotmail HTML internet law linux Mac OS X mailing list mailman MICT mod_rewrite monitor MSL MySQL name server Network PHP Postfix Security Smarty sony Spammail SPF theme TLS traffic log Universiade UTF-8 UTF8 vbulletin Wordpress การเมือง จตุคาม รูปภาพ สถิติ เรารักในหลวง
