MySQL 命令行參數 (v6.0.4)

C:\Documents and Settings\perton>mysql -hlocalhost -uroot -p****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 6.0.4-alpha-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> \h

For information about MySQL products and services, visit:http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:http://dev.mysql.com/
To buy MySQL Network Support, training, or other products, visit:https://shop.mysql.com/

List of all MySQL commands:
Note that all text commands must be first on line and end with ';'

? (\?) Synonym for `help'.
clear (\c) Clear command.
connect (\r) Reconnect to the server.
Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
NOTE: Takes the rest of the line as new delimiter.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
notee (\t) Don't write into outfile.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset.
Might be needed for processing binlog with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

For server side help, type 'help contents'

mysql>

在 Eclipse 中,安裝 Python 插件功能

首先,啟動 Eclipse 程式,從功能表
Help > Install New Software

image

選定 Word with: 右方的按鍵 Add,在新視窗中,補上下列訊息:
Name : PyDev
Location : http://pydev.org/updates
image

按下 OK 鍵後,原本的 Install 視窗會有 Pending 字樣產生,等待一段時間後,視窗中央部份會展開如下圖所示,
請勾選 PyDev for Eclipes 項目

image

按下 Next ,

image 

image

接受程式使用條款

image

系統做安裝的動作

image

image

重新啟動 Eclipse

哈哈,完成安裝作業了 !!

開發 PHP 的好用工具:Eclipse

Eclipse 是著名跨平台的自由集成開發環境(IDE)。最初主要用來Java語言開發;目前亦有人通過外掛程式使其作為C++PythonPHP等其他語言的開發工具。

Eclipse最初是由IBM公司開發,2001年11月貢獻給開源社區,現在它由非營利軟體供應商聯盟Eclipse基金會(Eclipse Foundation)管理。

Eclipse有專門用來開發PHP程式的工具:PHP Development Tools
可由 http://www.eclipse.org/pdt/ 下載。

若要使用 Eclipse 建置程式檔案,希望以 utf-8 格式存檔時,需做下列環境的調整:(默認是 ANSI 格式, encoding MS950)

  1. Windows > Preferences > General > Content Types,
    set UTF-8 as the default encoding for all content types.
  2. Windows > Preferences > General > Workspaces,
    set "Text file encoding" to "Other : UTF-8".
  3. Windows > Preferences > Web > CSS Files > Encoding = UTF-8
  4. Windows > Preferences > Web > HTML Files > Encoding = UTF-8

統一編號演算示例

image

文字說明:
(一) 長度:共八位數,全部為數字。
(二) 計算公式
1、各數字分別乘以 1, 2, 1, 2, 1, 2, 4, 1
2、公式如下:
D1 D2 D3 D4 D5 D6 D7 D8
* 1    2    1    2    1    2    4    1 (第一列 * 第二列)

A1 B1 A2 B2 A3 B3 B4 A4  (Bx:相乘後的十位數)
+    C1       C2       C3 C4        (Cx:相乘後的個位數)

X1 X2 X3 X4 X5 X6 X7 X8 (Xx:相加後的十位數)
                                    Y7       (Yx:相加後的個位數)
Z1= X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8  或
Z1= X1 + X2 + X3 + X4 + X5 + X6 + Y7 + X8

3、當第 7 位數為 7 者,可取相加之倒數第二位取 0 及 1 來計算如 Z1 及 Z2 計算其和。
4、假如 Z1 或 Z2 能被 10 整除,則表示營利事業統一編號正確。

(三) 範例 ( 以 0 0 2 3 8 7 7 8 為例 )
0 0 2 3 8 7 7 8
*
1 2 1 2 1 2 4 1 (第一列 * 第二列)

0 0 2 6 8 1 2 8 (Bx:相乘後的十位數)
+             4 8   (Cx:相乘後的個位數)

0 0 2 6 8 5 1 8 (Xx:相加後的十位數)
                  0    (Yx:相加後的個位數)
Z1= 0+ 0+ 2+ 6+ 8+ 5+ 1+ 8 = 30 或
Z2= 0+ 0+ 2+ 6+ 8+ 5+ 0+ 8 = 29
因 30 能被 10 整除,故營利事利統一編號正確。

OpenDataSource 使用技巧及延伸

之前,曾經寫下 OpenDataSource 的用法;這方法一般來說,是夠使用了。
http://pertonchang.blogspot.com/search?q=OpenDataSource+

不過,當你使用的特殊字元來當密碼的一部份內容時,可能就會有問題。
==> 會抓不到資料.

再看下 OpenDataSource 的語法
SELECT   *
FROM OPENDATASOURCE(
     'SQLOLEDB',
     'Data Source=ServerName;User ID=MyUID;Password=MyPass'
          ).Northwind.dbo.Categories

記得用雙引號(")將特殊字元括住
SELECT   *
FROM OPENDATASOURCE(
     'SQLOLEDB',
     'Data Source=ServerName;User ID=MyUID;Password= "MyPass"'
          ).Northwind.dbo.Categories

另外,再介紹一個 Linked Server 的用法
如果你的環境有在 SQL Server ,Security / Linked Servers 中設定,例如:LOCAL
image
image
image

跨資料庫抓資料的語法,就變成了

SELECT   *
FROM LOCAL
.Northwind.dbo.Categories

指標的迷失問題?

函式指標     Pointer to Function
( * f ) ()        指向函式位址的指標

指標函式     Pointer Function
* f ()           傳回指標值的函式
* ( f () )

陣列指標     Pointer to Array
( * f ) []         指向陣列位址的指標

指標陣列     Pointer Array
* f []            存放指標元素的陣列

FTP 問題的排解可能

在使用 FTP 功能的過程中,可能會遇到無法正常運作的情形,
這時,可參考下列使用建議:

1. FTP 使用 (21)
2. Active mode , Passive mode

3. 用FTPS... (990 & 989)
4. 為 User 開一個SSL VPN帳號來連FTP用.... (443)
5. 透過網路硬碟 (Skydrive, Dropbox.....) (80 & 443)
6. 在命令模式下執行,傳檔時要設定傳送的檔案格式,才不會造成收到的檔案異常