Objective: In this lab, you will install MySQL and configure and deploy a Web application that connects to a database in MySQL.
sudo apt-get install mysql-server
mysql --user=root -pThe password is password
GRANT ALL PRIVILEGES ON *.* TO tomcat@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql --user root -p < best.txt
$ mysql --user root -p
mysql> use best;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from inventory;
+--------+--------------------------------+------------+---------+----------+
| number | description | category | price | quantity |
+--------+--------------------------------+------------+---------+----------+
| 431 | Sony VAIO PCV-MSX30 | computers | 2499.99 | 4 |
| 236 | Compaq Presario CP-1100 | computers | 1299 | 29 |
| 421 | IBM ThinkPad 3200X | computers | 1750 | 4 |
| 422 | IBM ThinkPad 3200XS | computers | 1890 | 0 |
| 949 | U2 - Greatest Hits | music | 14.95 | 200 |
| 766 | The Beatles - White Album | music | 19.5 | 43 |
| 804 | Elvis Presley - The Golden Yea | music | 9.9 | 152 |
| 892 | Tom Petty - Wildflowers | music | 12.99 | 8 |
| 6587 | GE Cordless phone | telephones | 45 | 28 |
| 6588 | GE Cordless phone w/ headset | telephones | 59 | 15 |
| 6590 | Sony HL-50 desktop | telephones | 79.95 | 21 |
| 6591 | Sony HL-50S 90MHz desktop | telephones | 89.95 | 30 |
+--------+--------------------------------+------------+---------+----------+
12 rows in set (0.00 sec)
mysql>