BlogAD

2014年12月10日 星期三

SQL常用指令

複製 Table 

1.先copy schema

CREATE TABLE new_table LIKE old_table;

(for android sqlite : create table new_table as select column1,column2,....from old_table;)

2.複製資料到新table

INSERT new_table SELECT * FROM old_table;


修改 Table 的名稱

ALTER TABLE oldname RENAME TO newname


MySQL遠端存取設定
若要讓遠端存取必須修改設定檔中bind-address的值
要改成 bind-address = 0.0.0.0


參考資料:
http://blog.johnsonlu.org/category/mysql/