Book Image

Building Applications with Scala

By : Diego Pacheco
Book Image

Building Applications with Scala

By: Diego Pacheco

Overview of this book

<p>Scala is known for incorporating both object-oriented and functional programming into a concise and extremely powerful package. However, creating an app in Scala can get a little tricky because of the complexity the language has. This book will help you dive straight into app development by creating a real, reactive, and functional application. We will provide you with practical examples and instructions using a hands-on approach that will give you a firm grounding in reactive functional principles.</p> <p>The book will take you through all the fundamentals of app development within Scala as you build an application piece by piece. We’ve made sure to incorporate everything you need from setting up to building reports and scaling architecture. This book also covers the most useful tools available in the Scala ecosystem, such as Slick, Play, and Akka, and a whole lot more. It will help you unlock the secrets of building your own up-to-date Scala application while maximizing performance and scalability.</p>
Table of Contents (17 chapters)
Building Applications with Scala
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface

MySQL setup


We will use Slick with MySQL 5.6. However, Slick supports other relational databases like Oracle, SQL Server, DB2, and Postgres. First of all, we need to install MySQL in our machine. Open the console, and perform the following steps (for Ubuntu Linux, other OS (Windows/Mac), and distros, check out http://dev.mysql.com/downloads/mysql/):

$ sudo apt-get install mysql-server -y
$ mysql --version
$ service mysql status

After installation with apt-get, when you run the other two commands, you should see an output like this:

MySQL Installation

Once the installation is done and the MySQL server is up and running, we can move on and create the database. In order to get this, we will need to open the MySQL console. For development reasons, I did not put a password for root. However, for production, it is strongly recommended that you do use a strong password.

Execute the following command:

$ mysql -u root -p

This will give output as follows:

MySQL Console

Once you enter the MySQL console...