Creating a Test Table - Comment

This section describes how to create a new table for testing purpose with MySQL monitor.

In order to perform database related tests on MySQL server, I created a new table called "Comment" with MySQL command line tool:

C:\herong> \local\mysql\bin\mysql -u Herong -pTopSecret
mysql: [Warning] Using a password on the command line interface can 
   be insecure.

mysql> USE HerongDB;
Database changed

mysql> CREATE TABLE Comment (ID INTEGER PRIMARY KEY AUTO_INCREMENT,
    ->   Name VARCHAR(256), Comment LONGTEXT);
Query OK, 0 rows affected (0.02 sec)

mysql> INSERT INTO Comment (Name, Comment)
    ->   VALUES ('Herong', 'This is a test.');
Query OK, 1 row affected (0.36 sec)

mysql> SELECT * FROM Comment;
+----+--------+-----------------+
| ID | Name   | Comment         |
+----+--------+-----------------+
|  1 | Herong | This is a test. |
+----+--------+-----------------+
1 row in set (0.00 sec)

Note that table "Comment" has 3 columns:

Table of Contents

 About This Book

 PHP Installation on Windows Systems

 Integrating PHP with Apache Web Server

 charset="*" - Encodings on Chinese Web Pages

 Chinese Characters in PHP String Literals

 Multibyte String Functions in UTF-8 Encoding

 Input Text Data from Web Forms

 Input Chinese Text Data from Web Forms

MySQL - Installation on Windows

 MySQL 8.0 Download, Installation and Start

 mysqladmin - MySQL Admin Tool

 mysql - Command Line Tool

 Creating Database and User with MySQL Monitor

Creating a Test Table - Comment

 MySQL - Connecting PHP to Database

 MySQL - Character Set and Encoding

 MySQL - Sending Non-ASCII Text to MySQL

 Retrieving Chinese Text from Database to Web Pages

 Input Chinese Text Data to MySQL Database

 Chinese Text Encoding Conversion and Corruptions

 Archived Tutorials

 References

 Full Version in PDF/EPUB