Aaronlong31

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            12 Posts :: 3 Stories :: 17 Comments :: 0 Trackbacks

          2010年7月18日 #

          常見錯誤號對照表

          MySQL error code SQLSTATE code Error message

          1011 HY000 Error on delete of '%s' (errn %d)
          1021 HY000 Disk full (%s); waiting for someone to free some space . . .
          1022 23000 Can't write; duplicate key in table '%s'
          1027 HY000 '%s' is locked against change
          1036 HY000 Table '%s' is read only
          1048 23000 Column '%s' cannot be null
          1062 23000 Duplicate entry '%s' for key %d
          1099 HY000 Table '%s' was locked with a READ lock and can't be updated
          1100 HY000 Table '%s' was not locked with LOCK TABLES
          1104 42000 The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
          1106 42000 Incorrect parameters to procedure '%s'
          1114 HY000 The table '%s' is full
          1150 HY000 Delayed insert thread couldn't get requested lock for table %s
          1165 HY000 INSERT DELAYED can't be used with table '%s' because it is locked with LOCK TABLES
          1242 21000 Subquery returns more than 1 row
          1263 22004 Column set to default value; NULL supplied to NOT NULL column '%s' at row %ld
          1264 22003 Out of range value adjusted for column '%s' at row %ld
          1265 1000 Data truncated for column '%s' at row %ld
          1312 0A000 SELECT in a stored program must have INTO
          1317 70100 Query execution was interrupted
          1319 42000 Undefined CONDITION: %s
          1325 24000 Cursor is already open
          1326 24000 Cursor is not open
          1328 HY000 Incorrect number of FETCH variables
          1329 2000 No data to FETCH
          1336 42000 USE is not allowed in a stored program
          1337 42000 Variable or condition declaration after cursor or handler declaration
          1338 42000 Cursor declaration after handler declaration
          1339 20000 Case not found for CASE statement
          1348 HY000 Column '%s' is not updatable
          1357 HY000 Can't drop a %s from within another stored routine
          1358 HY000 GOTO is not allowed in a stored program handler
          1362 HY000 Updating of %s row is not allowed in %s trigger
          1363 HY000 There is no %s row in %s trigger
          posted @ 2010-08-11 11:13 Aaronlong31 閱讀(854) | 評論 (0)編輯 收藏

          之前一個監視應用的好工具JavaMelody,功能十分齊全,這次介紹個 
          稍微小點的,專門為TOMCAT 而設計的。下面講解其用法: 

          1 下載: 
          http://www.lambdaprobe.org/downloads/1.7/probe.1.7b.zip 
          2 解壓縮后,把probe.war放到TOMCAT的webapps下,設置server.xml 
          的context 
          3 設置用戶如下,在tomcat_user.xml中 
             vi /usr/local/tomcat/conf//tomcat-users.xml 

          <?xml version='1.0' encoding='utf-8'?> 
          <tomcat-users> 
                  <role rolename="manager"/> 
                  <role rolename="standard"/> 
                  <role rolename="tomcat"/> 
                  <role rolename="admin"/> 
                  <role rolename="role1"/> 
                  <user username="tomcat" password="tomcat" roles="tomcat"/> 
                  <user username="both" password="tomcat" roles="tomcat,role1"/> 
                  <user username="probe" password="probe" roles="admin,manager"/> 
                  <user username="role1" password="tomcat" roles="role1"/> 
          </tomcat-users> 

          4 設置環境變量,獲取服務器狀態 
          # vi /etc/profile 
          JAVA_OPTS=-Dcom.sun.management.jmxremote 
          export JAVA_OPTS 

          5 重啟動服務器 
          6 輸入http://localhost/probe/,輸入用戶名和密碼 
          7 即可進入,這里比較精彩的是對內存的監視,動態顯示了JVM的內存圖表
          posted @ 2010-08-09 12:51 Aaronlong31 閱讀(400) | 評論 (0)編輯 收藏

          設置每天8:50開機,要是9:15電腦還沒人使用.就自動關機.
          計算機啟動時按“Delete”鍵進入BIOS界面。
          在BIOS設置主界面中選擇“Power Management Setup”菜單,
          Resume By Alarm 值設成Enabled
          再在”Date (of Month) Alarm”和“Time (hh:mm:ss) Alarm”中設定開機的日期和時間。
          如果把“Date”設為0,則默認為每天定時開機。
          設置好后按“F10“保存設置就可以了,機器會重新啟動,設置成功。
          自動登錄
          單擊“開始/運行”,輸入“rundll32 netplwiz.dll,UsersRunDll”
          按回車鍵后彈出“用戶帳戶”窗口
          然后取消選定“要使用本機,用戶必須輸入用戶名和密碼”選項,單擊確定
          在彈出的對話框中輸入你想讓電腦每次自動登錄的賬戶和密碼即可。
          自動關機
          1.控制面板>管理工具>服務
          雙擊名稱列為 Task Scheduler 的記錄,把啟動類型設為自動,再點啟動按鈕,再保存.
          再從運行中輸入
          at 9:15 /every:M,T,W,Th,F,S,Su shutdown -s -f -t 300 -c "快要停電了,取消關機命令shutdown -a"
          第天9:15 執行關機,有300秒的等待時間。
          posted @ 2010-08-09 12:45 Aaronlong31 閱讀(416) | 評論 (0)編輯 收藏

          1.修改linux的時間可以使用date指令

          在命令行輸入:

          date
           顯示當前時間 Fri Aug  3 14:15:16 CST 2007

          date -s 
          按字符串方式修改時間
          可以只修改日期,不修改時間,輸入: date -s 2007-08-03
          只修改時間,輸入:date -s 14:15:00
          同時修改日期時間,注意要加雙引號,日期與時間之間有一空格,輸入:date -s "2007-08-03 14:15:00"

          修改完后,記得輸入:clock -w 
          把系統時間寫入CMOS

          2.Linux下啟動/關閉/重啟Mysql
          /etc/init.d/mysql   start|stop|restart|reload|force-reload
          posted @ 2010-08-06 10:02 Aaronlong31 閱讀(246) | 評論 (0)編輯 收藏

          使用PowerDesigner設計數據庫時,要寫很多comment讓人看,生成SQL文件時也包含了這些comment,但是用這SQL文件生成數據庫時,經常會因為comment太長而失敗,在文件中一點一點的刪除comment未免太麻煩。這里有個方法可以讓PowerDesigner生成SQL文件時不包含comment。(我使用的是mysql,估計其他的也差不多。)


          選擇Edit current DBMS,依次點開script -> objects -> table -> create ,在value中將最后的[comment = "%TLABL%"]刪除,這個是去掉創建表的comment。
          script -> objects -> column -> create,在value中將最后的[ comment %.q:@OBJTLABL%]去掉,這個是去掉column的comment的。
          這樣生成SQL文件時就不會產生comment了。

          另外還有一點,如果數據庫設計中有index,生成SQL文件時會把drop index 放到文件的最前面,當第一次生成數據庫時,由于沒有index所以會報錯,因此要把最前面的drop index刪掉,但手動刪除還是麻煩,可以這樣:
          CTRL + G,打開Database Generation,選擇options選項卡,選擇index,把右邊的Drop index前的√去掉就行了
          posted @ 2010-07-18 10:57 Aaronlong31 閱讀(4651) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 松溪县| 明光市| 长岛县| 阳朔县| 秀山| 申扎县| 察哈| 天长市| 奉新县| 长沙市| 柳江县| 中卫市| 西安市| 望谟县| 凤翔县| 四川省| 石门县| 江陵县| 莒南县| 沁水县| 凤山市| 桂东县| 吕梁市| 且末县| 龙口市| 宜兰县| 新蔡县| 石河子市| 井研县| 武乡县| 衡山县| 杂多县| 天镇县| 沅江市| 腾冲县| 大埔区| 琼中| 乌拉特前旗| 海丰县| 宁南县| 苍梧县|