Outdated: Creating First Table in MySQL 4.0

A tutorial example is provided on how to verify a new installation of 4.0.18 by creating a new test table and insert some data to the table.

In the previous section, we learned how to start and shutdown MySQL server. Now let's see how we can use MySQL client interface to create a table and run queries. First start the MySQL server in one command window, then run the start the MySQL client interface in another command window, and run the following MySQL client commands:

\mysql\bin\mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.18-max-debug

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

mysql> show databases;
+----------+
| Database |
+----------+
| mysql    |
| test     |
+----------+
2 rows in set (0.06 sec)

mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> create table hello (message varchar(80));
Query OK, 0 rows affected (0.58 sec)

mysql> insert into hello (message) values ('Hello world!');
Query OK, 1 row affected (0.38 sec)

mysql> select * from hello;
+--------------+
| message      |
+--------------+
| Hello world! |
+--------------+
1 row in set (0.04 sec)

mysql> drop table hello;
Query OK, 0 rows affected (0.34 sec)

mysql> quit;
Bye

Last update: 2015.

Table of Contents

 About This Book

 Introduction of SQL

 MySQL Introduction and Installation

 Introduction of MySQL Programs

 Perl Programs and MySQL Servers

 PHP Programs and MySQL Servers

 Java Programs and MySQL Servers

 Datatypes and Data Literals

 Operations and Expressions

 Character Strings and Bit Strings

 Commonly Used Functions

 Table Column Types for Different Types of Values

 Using DDL to Create Tables and Indexes

 Using DML to Insert, Update and Delete Records

 Using SELECT to Query Database

 Transaction Management and Isolation Levels

 Locks Used in MySQL

 Defining and Calling Stored Procedures

 Variables, Loops and Cursors Used in Stored Procedures

Outdated Tutorials

 Outdated: Installing MySQL 5.6.28

 Outdated: Installing MySQL 5.5.15

 Outdated: Installing MySQL 5.0.2 (Alpha)

 Outdated: Installing MySQL 4.0.18

Outdated: Creating First Table in MySQL 4.0

 References

 PDF Printing Version