對這文章發表回應
發表限制: 非會員 可以發表
發表者: 冷日 發表時間: 2012/9/19 2:32:08
檢查資料表是否存在
$tbchkres 回傳 1 代表存在,回傳 0 代表不存在。
Create table from other table's structure
根據已經存在的資料表結構自動建立新資料表
mysqldump
假設 MySQL 的使用者名稱是 username,欲輸出的資料庫名稱為 database,輸出至 dump.sql
BigDump: Staggered MySQL Dump Importer
http://www.ozerov.de/bigdump.php
將龐大的 .sql 檔倒進去資料庫中,可避免 phpmyadmin 中 php.ini 上傳檔案限制大小,使 .sql 沒辦法上傳上去。
Backup
10 Ways to Automatically & Manually Backup MySQL Database
http://www.noupe.com/php/10-ways-to-automatically-manually-backup-mysql-database.html
MySQL 資料庫增量備份
http://blog.miniasp.com/post/2009/07/How-to-MySQL-Incremental-Backup-using-Binary-Log.aspx
Forgot Root Password
忘記 MySQL Root 密碼時可重新設定密碼。
停止 MySQL Server 後,重新啟動 Server,並增加參數「–skip-grant-tables」
使用無密碼之 root 帳號登入 MySQL
重新設定 root 密碼
重新啟動 MySQL Server 後即可用新密碼登入。
Ref: http://www.thegeekstuff.com/2009/07/how-to-reset-forgot-mysql-root-password-on-unix-linux-windows/
參考 https://wiki.sars.tw/doku.php?id=mysql:basic
取得 Table 的註解
--標準寫法
--也可以寫成
參考 http://liaosankai.pixnet.net/blog/post/18480448
原文出處:幾個有關資料庫操作 | 資訊組部落格
$tbchk = "SHOW TABLES LIKE '$table' ";
$tbchkres = mysql_query($tbchk);
$tbchkres 回傳 1 代表存在,回傳 0 代表不存在。
Create table from other table's structure
根據已經存在的資料表結構自動建立新資料表
CREATE TABLE 'new_table' LIKE 'old_table';
mysqldump
假設 MySQL 的使用者名稱是 username,欲輸出的資料庫名稱為 database,輸出至 dump.sql
mysqldump --user=username --password --default-character-set=latin1 database 〉 dump.sql
BigDump: Staggered MySQL Dump Importer
http://www.ozerov.de/bigdump.php
將龐大的 .sql 檔倒進去資料庫中,可避免 phpmyadmin 中 php.ini 上傳檔案限制大小,使 .sql 沒辦法上傳上去。
Backup
10 Ways to Automatically & Manually Backup MySQL Database
http://www.noupe.com/php/10-ways-to-automatically-manually-backup-mysql-database.html
MySQL 資料庫增量備份
http://blog.miniasp.com/post/2009/07/How-to-MySQL-Incremental-Backup-using-Binary-Log.aspx
Forgot Root Password
忘記 MySQL Root 密碼時可重新設定密碼。
停止 MySQL Server 後,重新啟動 Server,並增加參數「–skip-grant-tables」
# mysqld_safe --skip-grant-tables &
使用無密碼之 root 帳號登入 MySQL
# mysql -u root mysql
重新設定 root 密碼
mysql> UPDATE user SET password=PASSWORD('newpassword') WHERE user='root';
mysql> flush privileges;
重新啟動 MySQL Server 後即可用新密碼登入。
Ref: http://www.thegeekstuff.com/2009/07/how-to-reset-forgot-mysql-root-password-on-unix-linux-windows/
參考 https://wiki.sars.tw/doku.php?id=mysql:basic
取得 Table 的註解
--標準寫法
SHOW FULL FIELDS FROM database.table
--也可以寫成
SHOW FULL FIELDS FROM table FROM database
參考 http://liaosankai.pixnet.net/blog/post/18480448
原文出處:幾個有關資料庫操作 | 資訊組部落格