国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

mysql中使用過程中常見錯誤解決辦法收集

2024-07-24 12:38:50
字體:
來源:轉載
供稿:網友

mysql中使用過程中常見錯誤解決辦法收集,大家可參考本文章收藏的錯誤解決辦法.

1、Mysql errono 1005:主外鍵不是完全一致,請檢查如下幾點:

a、字段是否存在 

b、類型是否一致(注意unsigned , powerdesign 生成問題)

c、數據庫引擎是否一致

d、字符編碼是否一致

e、windows平臺下注意修改lower_case_table_names = 0,windows本身不區分文件大小寫,改為0之后就區分了可能造成找不到引用的表 

2、Mysql errono 121:外鍵約束名稱重復.

3、記錄 Mysql WorkBench 中單詞縮寫意義:

  1. PK: primary key (column is part of a pk)  
  2. NN: not null (column is nullable)  
  3. UQ: unique (column is part of a unique key)  
  4. AI: auto increment (the column is auto incremented when rows are inserted)  --Vevb.com 
  5. BIN: binary (if dt is a blob or similar, this indicates that is binary data, rather than text)  
  6. UN: unsigned (for integer types, see docs: “10.2. Numeric Types”)  
  7. ZF: zero fill (rather a display related flag, see docs: “10.2. Numeric Types”)  

4、mysql 權限設置

  1. //添加遠程主機訪問MYSQL root權限 
  2. insert into user(host,user,password) values('%','root',PASSWORD('root')); 
  3. //root 權限授權 
  4. grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option; 
  5. //更新權限設置 
  6. flush privileges; 

5、防火墻設置

  1. //打開端口 
  2. /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT 
  3. //保存 
  4. /etc/rc.d/init.d/iptables save 
  5. //查看狀態 
  6. /etc/init.d/iptables status 

6、開機自動運行(實現類似Windows服務).

  1. /sbin/chkconfig --level 2345 mysqld on 
  2. /sbin/chkconfig --list 
  3. 結果如下: 
  4. mysqld 0:off  1:off  2:on  3:on  4:on  5:on  6:off 

7、linux下安裝了mysql,不能從其它機器訪問,帳號已經授權從任意主機進行訪問.

vi /etc/sysconfig/iptables:在后面添加:-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

service iptables restart

發現還是不行,最終發現記錄要添加在:-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT 這一條前面 再次重啟 OK

8、忘記mysql密碼

  1. Microsoft Windows [版本 5.2.3790] 
  2.  
  3.   (C) 版權所有 1985-2003 Microsoft Corp. 
  4.  
  5.   C:Documents and SettingsAdministrator>cd D:webwww.php100.comMysqlMySQL Se 
  6.  
  7.   rver5.5bin 
  8.  
  9.   C:Documents and SettingsAdministrator>d: 
  10.  
  11.   D:webwww.php100.comMysqlMySQL Server5.5bin>mysql 
  12.  
  13.   Welcome to the MySQL monitor. Commands end with ; or g. 
  14.  
  15.   Your MySQL connection id is 1 
  16.  
  17.   Server version: 5.5.10 MySQL Community Server (GPL) 
  18.  
  19.   Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 
  20.  
  21.   Oracle is a registered trademark of Oracle Corporation and/or its 
  22.  
  23.   affiliates. Other names may be trademarks of their respective 
  24.  
  25.   owners. 
  26.  
  27.   Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. 
  28.  
  29.   mysql> use mysql; 
  30.  
  31.   Database changed 
  32.  
  33.   mysql> update user set password=password("520"where user="root"
  34.  
  35.   Query OK, 1 row affected (0.00 sec) 
  36.  
  37.   Rows matched: 1 Changed: 1 Warnings: 0 
  38.  
  39.   mysql> flush privileges
  40.  
  41.   Query OK, 0 rows affected (0.00 sec) 
  42.  
  43.   mysql> q 
  44.  
  45.   Bye 
  46.  
  47.   D:webm.survivalescaperooms.comMysqlMySQL Server5.5bin> 

9、mysql 2003錯誤解決辦法

MySQL 服務器資源緊張,導致無法連接.

解決方法:

1、如果你是虛擬主機用戶(購買的空間),則聯系空間商檢查 MySQL 是否正常啟動,并確認 MySQL 的配置信息(是否為 localhost);

2、如果你是獨立主機用戶(擁有管理主機權限),則按下面步驟檢查:

1)檢查是否啟動了 MySQL 服務.

Windows 主機的話,右鍵點擊我的電腦,單擊管理,在服務和應用程序中找到 MySQL 服務,看是否是已啟動的狀態.

如果出現"ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)", 說明你的MySQL還沒有啟動.

解決辦法:

第一步,刪除c:windowns下面的my.ini.

第二步,打開c:mysqlbinwinmysqladmin.exe 輸入用戶名 和密碼.

第三步 在dos下 輸入 mysqld-nt -remove 刪除服務.

在接著輸入 mysqld-nt -install.

第四步 輸入mysql 啟動成功.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 芦山县| 稷山县| 平定县| 曲阜市| 岳阳县| 桦南县| 霞浦县| 乌兰浩特市| 青浦区| 洮南市| 三门县| 辉南县| 武安市| 海丰县| 拉孜县| 沁源县| 武乡县| 措美县| 噶尔县| 贞丰县| 循化| 河北省| 荆州市| 鸡泽县| 沽源县| 宜章县| 如东县| 太仆寺旗| 文安县| 西充县| 台东县| 龙川县| 宝坻区| 密山市| 利津县| 常山县| 手机| 泊头市| 洪湖市| 博客| 依兰县|