MYSQL 事件 engines=INNODB

來源:互聯網
上載者:User

標籤:

  1. 如果出現“#skip-innodb”則將“#”去掉,重啟MySQL;

  2. 如果第一條無法解決,加上配置:default-storage-engine=InnoDB 再重啟MySQL。

  3. 進入MYsql資料據mysql>show engines;

 

轉自百度經驗:http://jingyan.baidu.com/article/3a2f7c2e68ac4426afd61108.html

感謝百度經驗

 

 

交易處理資料

 1 <?php 2 try{ 3 $pdo=new PDO("mysql:host=xxxx;dbname=xxxx","xxxx","xxxx"); 4 $pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); 5 $pdo->setAttribute(PDO::ATTR_AUTOCOMMIT,0); 6  7 }catch(PDOException $e){ 8 echo "資料庫連接失敗:".$e->getMessage(); 9 exit;10 }11 12 //exce()返回影響的行數;13 // $affected_rows=$pdo->exec("insert into shops(name,price,num,desn)values(‘aa‘,‘12.1‘,‘10‘,‘good‘)");14 // echo "最後插入的自動成長的id".$pdo->lastInsertId();15 16 //設定錯誤報表模式17 //if(!$affected_rows){18 // echo $pdo->errorCode()."<br>";19 // print_r($pdo->errorInfo());20 21 //}else{22 23 // echo"執行成功";24 //}25 26 try{27 $pdo->beginTransaction();28 $price=500;29 $sql="update zhanghao set price=price-{$price} where id=1";30 31 $affected_rows=$pdo->exec($sql);32 33 $sql="update zhanghao set price=price+{$price} where id=2";34 35 $affected_rows=$pdo->exec($sql);36 echo("交易成功");37 $pdo->commit();38 39 }catch(PDOException $e){40 echo $e->getMessage();41 $pdo->rollBack();42 }43 44 ?>
View Code

 

MYSQL 事件 engines=INNODB

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.