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;

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
linux/server/mysql.txt · Last modified: 2007/11/15 03:15 by john
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki