標籤:由於centos7預設不再是mysql資料庫,所以度算手動安裝一個。全程參考http://www.2cto.com/database/201501/371451.html這裡摘抄以下這個連結的內容,並根據自己的實際安裝情況進行一些補充。選擇下載MySQL Community Server (GPL)版本,由於MySQL Community Server
標籤:出現這種情況應該是在跑業務的時候,mysql資料庫異常中斷導致表異常,查看mysql日誌報錯如下[[email protected] opt]# tail -n 5/var/log/mysqld.log 16082713:29:33[ERROR]/usr/libexec/mysqld:Table‘./ivr/T_CDR‘ is marked as crashed and should be repaired16082713:29:40[ERROR]/usr/libexec/
標籤:對於不是採用所有欄位都是not null的mysql表設計而言,mysql提供了一個<=>操作符。在oracle中我們的處理方式通常類似:where a = #{var} or #{var} is null或者where a = nvl(#{var},‘ ‘) or nvl(#{var},‘ ‘) = ‘ ‘在mysql中則是:where a = ifnull(#{var},‘ ‘) or ifnull(#{var},‘ ‘) = ‘ ‘或者:where a= #{var}
標籤: 基礎SQL語句,記錄以備查閱。(在HeiDiSql中執行)# 建立資料庫Create Database If Not Exists VerifyIdear Character Set UTF8;# 建立表Create Table If Not Exists VerifyIdear.MyTable( ID Bigint(8) unsigned Primary key Auto_Increment, Updatetime DateTime, name VarChar(1
標籤:/* 在資料庫中建立一個Employee的類 create table Employee( id int primary key, name varchar(20), age int); */import java.sql.*;public class JDBCTest { public static void main(String[] args){ String user="user1"; String passwd="pwd1";
標籤:mysql常用的hint對於經常使用oracle的朋友可能知道,oracle的hint功能種類很多,對於最佳化sql語句提供了很多方法。同樣,在mysql裡,也有類似的hint功能。下面介紹一些常用的。強制索引 FORCE INDEX SELECT * FROM TABLE1 FORCE INDEX (FIELD1) …以上的SQL語句只使用建立在FIELD1上的索引,而不使用其它欄位上的索引。忽略索引 IGNORE INDEX SELECT *