Mysql 錯誤問題匯總(不斷更新中)
更新時間:2012年07月17日 23:23:35 作者:
Mysql 錯誤問題匯總,我們在開發(fā)過程中經(jīng)常看到mysql的一些錯誤,這里整理下,方便需要的朋友
1、Mysql errono 1005 : 主外鍵不是完全一致 , 請檢查如下幾點:
a、字段是否存在
b、類型是否一致(注意unsigned , powerdesign 生成問題)
c、數(shù)據(jù)庫引擎是否一致
d、字符編碼是否一致
e、windows平臺下注意修改lower_case_table_names = 0, windows本身不區(qū)分文件大小寫,改為0之后就區(qū)分了可能造成找不到引用的表
2、Mysql errono 121: 外鍵約束名稱重復(fù)
3、記錄 Mysql WorkBench 中單詞縮寫意義:
PK: primary key (column is part of a pk)
NN: not null (column is nullable)
UQ: unique (column is part of a unique key)
AI: auto increment (the column is auto incremented when rows are inserted)
BIN: binary (if dt is a blob or similar, this indicates that is binary data, rather than text)
UN: unsigned (for integer types, see docs: “10.2. Numeric Types”)
ZF: zero fill (rather a display related flag, see docs: “10.2. Numeric Types”)
4、mysql 權(quán)限設(shè)置
//添加遠程主機訪問MYSQL root權(quán)限
insert into user(host,user,password) values('%','root',PASSWORD('root'));
//root 權(quán)限授權(quán)
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
//更新權(quán)限設(shè)置
flush privileges;
5、防火墻設(shè)置
//打開端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
//保存
/etc/rc.d/init.d/iptables save
//查看狀態(tài)
/etc/init.d/iptables status
6、開機自動運行(實現(xiàn)類似Windows服務(wù))
/sbin/chkconfig --level 2345 mysqld on
/sbin/chkconfig --list
結(jié)果如下:
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
a、字段是否存在
b、類型是否一致(注意unsigned , powerdesign 生成問題)
c、數(shù)據(jù)庫引擎是否一致
d、字符編碼是否一致
e、windows平臺下注意修改lower_case_table_names = 0, windows本身不區(qū)分文件大小寫,改為0之后就區(qū)分了可能造成找不到引用的表
2、Mysql errono 121: 外鍵約束名稱重復(fù)
3、記錄 Mysql WorkBench 中單詞縮寫意義:
PK: primary key (column is part of a pk)
NN: not null (column is nullable)
UQ: unique (column is part of a unique key)
AI: auto increment (the column is auto incremented when rows are inserted)
BIN: binary (if dt is a blob or similar, this indicates that is binary data, rather than text)
UN: unsigned (for integer types, see docs: “10.2. Numeric Types”)
ZF: zero fill (rather a display related flag, see docs: “10.2. Numeric Types”)
4、mysql 權(quán)限設(shè)置
//添加遠程主機訪問MYSQL root權(quán)限
insert into user(host,user,password) values('%','root',PASSWORD('root'));
//root 權(quán)限授權(quán)
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
//更新權(quán)限設(shè)置
flush privileges;
5、防火墻設(shè)置
//打開端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
//保存
/etc/rc.d/init.d/iptables save
//查看狀態(tài)
/etc/init.d/iptables status
6、開機自動運行(實現(xiàn)類似Windows服務(wù))
/sbin/chkconfig --level 2345 mysqld on
/sbin/chkconfig --list
結(jié)果如下:
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
您可能感興趣的文章:
- mysql服務(wù)無法啟動報錯誤1067解決方法(mysql啟動錯誤1067 )
- mysql啟動的error 2003和1067錯誤問題解決方法
- Mysql數(shù)據(jù)庫錯誤代碼中文詳細(xì)說明
- MySQL啟動1053錯誤解決方法
- 解決mysql 1040錯誤Too many connections的方法
- mysql Out of memory (Needed 16777224 bytes)的錯誤解決
- mysql服務(wù)1067錯誤多種解決方案分享
- mysql 提示INNODB錯誤的解決方法
- MySQL 1303錯誤的解決方法(navicat)
- mysql 發(fā)生系統(tǒng)錯誤1067的解決方法
- MySql 安裝時的1045錯誤
- mysql常見錯誤集錦
- MySQL 1067錯誤解決方法集合
- MySQL錯誤代碼大全
相關(guān)文章
MySQL通過觸發(fā)器解決數(shù)據(jù)庫中表的行數(shù)限制詳解及實例
這篇文章主要介紹了MySQL通過觸發(fā)器解決數(shù)據(jù)庫中表的行數(shù)限制詳解及實例的相關(guān)資料,需要的朋友可以參考下2017-04-04Mysql數(shù)據(jù)庫慢查詢常用優(yōu)化方式
數(shù)據(jù)庫SQL優(yōu)化是老生常談的問題,下面這篇文章主要給大家介紹了關(guān)于Mysql數(shù)據(jù)庫慢查詢常用優(yōu)化方式,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-05-05在linux服務(wù)器上配置mysql并開放3306端口的操作步驟
這篇文章主要介紹了在linux服務(wù)器上配置mysql并開放3306端口,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-09-09