mysql 的資料庫內容替換

2021-08-30 01:39:01 字數 419 閱讀 1700

ps:下面是轉過來的,用於記錄下,這個不是正則的初衷,只是用了regexp而已,正則的更靈活更方便

將comment表中的author_url包含www.sohu.com的記錄,其中的sohu替換為sina,乙個語句搞定~

update comment set author_url=replace(author_url,'sohu','sina') where author_url regexp 'www.sohu.com';

帶if判斷的複雜替換

update comment set url=if(url regexp 'test.yahoo.com.cn',replace(url,'www1.sohu.com','www.sina.com'),replace(url,'www2.yahoo.com','www.sina.com')) where 1=1;

mysql資料庫內容的匯出!

上網查了下有說用mysql bin mysqldump p 資料庫名稱 d txt 匯出該資料庫內的所有內容到d盤的 txt檔案中,之後要輸入密碼。但是我試了試,不行!我這樣試了,結果行了 d mysql5 bin mysqldump u使用者名稱 p密碼 no create db true no ...

顯示資料庫內容

建立asp檔案後,include conn.asp檔案 然後就是 dim rs set rs server.createobject adodb.recordset rs.open select from 表名 cnn,1,1,adcmdtext rs就是記錄集。open後面是表名則最後引數為adc...

資料庫內容整理

寫在前面 mysql是最流行的關係型資料庫管理系統,在web應用方面mysql是最好的rdbms relational database management system 關聯式資料庫管理系統 應用軟體之一。mysql是乙個多使用者,多執行緒的sql資料庫伺服器,以客戶機 伺服器結構的實現,由乙個...