# Connecting to a MySQL Database from Codename One

DevFeed: [Connecting to a MySQL Database from Codename One](<https://devfeed.tech/articles/connecting-to-a-mysql-database-from-codename-one-19268.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/connecting-to-a-mysql-database/>)

Author: Steve Hannah

Published: 2016-11-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [MySQL](<https://devfeed.tech/topics/mysql.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [backend-development](<https://devfeed.tech/topics/backend-development.md>), [PHP](<https://devfeed.tech/topics/php.md>), [LAMP](<https://devfeed.tech/topics/lamp.md>), [XAMPP](<https://devfeed.tech/topics/xampp.md>), [Web](<https://devfeed.tech/topics/web.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [database](<https://devfeed.tech/tags/database.md>), [development](<https://devfeed.tech/tags/development.md>), [lamp](<https://devfeed.tech/tags/lamp.md>), [mobile-apps](<https://devfeed.tech/tags/mobile-apps.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [php](<https://devfeed.tech/tags/php.md>), [server-side-development](<https://devfeed.tech/tags/server-side-development.md>), [web](<https://devfeed.tech/tags/web.md>)

## AI overview

This tutorial demonstrates how to combine a MySQL database, a web-service layer, and a Codename One client application to build a Contacts app. It uses Xataface with PHP, a LAMP stack, XAMPP for development, and the Sakila sample database.

## Source excerpt

In the following series of blog posts I'm going to shift some attention to server-side development in so much as it can complement a Codename One client application. In this post I'll demonstrate how you can combine a MySQL database, a web-service layer, and a Codename One client to produce a "Contacts" app. I'm going to steal the Contacts code from the Kitchen Sink demo for the UI, but I'll implement a different datasource that loads the contacts from a remote MySQL database instead of from the phone's internal contacts.