這裏顯示兩個版本的差異處。
| Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
|
mysql:basic [2009/10/07 13:35] wenpei Forgot Root Password |
mysql:basic [2016/06/01 10:32] (目前版本) sars [mysqldump] |
||
|---|---|---|---|
| 行 8: | 行 8: | ||
| ===== Techotopia: MySQL Essentials ===== | ===== Techotopia: MySQL Essentials ===== | ||
| http://www.techotopia.com/index.php/MySQL_Essentials | http://www.techotopia.com/index.php/MySQL_Essentials | ||
| + | |||
| + | ====== Check table exist or not ====== | ||
| + | 檢查資料表是否存在 | ||
| + | <code> | ||
| + | $tbchk = "SHOW TABLES LIKE '$table' "; | ||
| + | $tbchkres = mysql_query($tbchk); | ||
| + | </code> | ||
| + | |||
| + | $tbchkres 回傳 1 代表存在,回傳 0 代表不存在。 | ||
| + | |||
| + | ====== Create table from other table's structure ====== | ||
| + | 根據已經存在的資料表結構自動建立新資料表 | ||
| + | CREATE TABLE `new_table` LIKE `old_table`; | ||
| ====== mysqldump ====== | ====== mysqldump ====== | ||
| 行 14: | 行 27: | ||
| mysqldump --user=username --password --default-character-set=latin1 database 〉 dump.sql | mysqldump --user=username --password --default-character-set=latin1 database 〉 dump.sql | ||
| + | ===== Ref ===== | ||
| + | * [[https://serversforhackers.com/mysqldump-with-modern-mysql|Mysqldump with Modern MySQL]] | ||
| ====== BigDump: Staggered MySQL Dump Importer ====== | ====== BigDump: Staggered MySQL Dump Importer ====== | ||
| http://www.ozerov.de/bigdump.php | http://www.ozerov.de/bigdump.php | ||
| 行 44: | 行 59: | ||
| Ref: http://www.thegeekstuff.com/2009/07/how-to-reset-forgot-mysql-root-password-on-unix-linux-windows/ | Ref: http://www.thegeekstuff.com/2009/07/how-to-reset-forgot-mysql-root-password-on-unix-linux-windows/ | ||
| + | |||
| + | ====== JOIN ====== | ||
| + | {{ :mysql:1512745_645876362117204_338708950_n.png?nolink&800 |}} | ||