Chapter 9 Exercise - MySQL

  1. go into https://mysql-admin.umbc.edu/. login and see how it works.
  2. change password.
  3. create a table with 4 rows and 5 columns.
  4. ssh to gl and go into mysql using the command line.
  5. do a select all on your table.
  6. put the command-line output text into a text file.
  7. create a php file that displays your mysql table as an html table.
  8. submit 2 urls - one for .txt and one for .php.

References

  1. http://www.tizag.com/mysqlTutorial/mysqlselect.php (uses php4)
  2. http://www.mobilefish.com/developer/mysql/mysql_quickguide_commands.html

Command-line sample

=>mysql -u jianwu -h studentdb-maria.gl -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2147854
Server version: 4.1.18-log

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

(jianwu@studentdb-maria.gl) [(none)]> use jianwu;
Database changed
(jianwu@studentdb-maria.gl) [jianwu]> show tables;
+--------------------+
| Tables_in_jianwu |
+--------------------+
| comments           |
| entries            |
| tests              |
+--------------------+
21 rows in set (0.01 sec)

(jianwu@studentdb-maria.gl) [jianwu]> select * from tests;
+----+------------+
| id | date       |
+----+------------+
|  3 | 03/04/2016 |
|  4 | 04/04/2016 |
+----+------------+
2 rows in set (0.00 sec)

(jianwu@studentdb-maria.gl) [jianwu]> \q
Bye
=>