Skip to Content
Mastering PHP 7
book

Mastering PHP 7

by Branko Ajzele
June 2017
Intermediate to advanced
536 pages
9h 49m
English
Packt Publishing
Content preview from Mastering PHP 7

Setting up sample data

Before we move onto querying MySQL, let's go ahead and set up some sample data. MySQL provides a sample database called Sakila, which we can download from the official MySQL site, as follows:

cd ~wget http://downloads.mysql.com/docs/sakila-db.tar.gztar -xzf sakila-db.tar.gzcd sakila-db/

Once downloaded and unpacked, this should give us the following three files:

Moving forward, we need to see how we can import sakila-schema.sql and sakila-data.sql. Luckily, MySQL provides several ways to do this. A quick look at the sakila-schema.sql file shows the following entries at the top of the file:

DROP SCHEMA IF EXISTS sakila; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning PHP 7

Learning PHP 7

Antonio L Zapata (GBP)
Upgrading to PHP 5

Upgrading to PHP 5

Adam Trachtenberg

Publisher Resources

ISBN: 9781785882814Supplemental Content