Table of Contents

MySQL Information

maintenance tips

reset auto increment value

ALTER TABLE tablename DROP id, ADD id MEDIUMINT AUTO_INCREMENT, AUTO_INCREMENT = 1

In order for the AUTO_INCREMENTing to work, you must readd the column with its original datatype. In this example the dropped id column was of the datatype MEDIUMINT

copy a table

CREATE TABLE new_tbl SELECT * FROM orig_tbl;

key buffer size information (and other info)

table cache IMPORTANT READ

how to avoid sql injection - IMPORTANT READ

how to store arrays in mysql via php

10 MySQL optimization tips

Bored@ Server Tweaks

[root@boredat etc]# diff -u my.cnf.orig my.cnf
--- my.cnf.orig 2006-12-01 00:13:21.000000000 -0500
+++ my.cnf      2006-12-01 00:34:08.000000000 -0500
@@ -5,6 +5,16 @@
 # clients (those using the mysqlclient10 compatibility package).
 old_passwords=1
 skip-networking
+
+#added by John Friar
+key_buffer = 64M
+max_connections = 150
+sort_buffer_size = 20M
+read_buffer_size = 524288
+read_rnd_buffer_size = 2M
+table_cache = 600
+thread_cache_size = 16
+tmp_table_size = 64M
 
 [mysql.server]
 user=mysql