以下是基於xampp 1.6.1 (MySQL 5.0.37) 版本 Connect to MySQL (初安裝完成時, 帳號root, 無密碼) c:\xampp\mysql\bin>mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 26 Server version: 5.0.37 Source distribution 建立資料庫 database name: demo, 設定預設編碼為Big5 (預設編碼可以略過不設) mysql> CREATE DATABASE demo DEFAULT CHARACTER SET big5 COLLATE big5_chinese_ci; Query OK, 1 row affected (0.00 sec) or mysql> CREATE DATABASE demo; Query OK, 1 row affected (0.00 sec) 設定資料庫可自遠端存取的帳號 帳號:andy 密碼:password 來自: 192.168.182.1 mysql> GRANT ALL ON demo.* TO “andy”@”192.168.182.1 ” IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec) create table: MyClass 參考自: http://c.biancheng.net/cpp/html/1449.html 欄位名 數位類型 數據寬度 是否為空 是否主鍵 自動增加 預設值 id int 4 否 primary key auto_increment name char 20 否 sex int 4 否 0 degree double 16 是 ...