SQL Based Phone Directory
Goal
To examine and set up an SQL based C++, Python based Web phone directory using MySQL.
You will use from the following projects:
- C++ Version: https://github.com/jimskon/ContactCpp
- Python Version: https://github.com/jimskon/contactPy
Method
Step 1 – Get the demo software running from your account and with your Database:
- Use git to get the project you want.
- Make sure MariaDB is installed: https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-22-04
- Make sure the MariaDB connector is installed
For C++: Link
For Python: https://mariadb.com/docs/skysql/connect/programming-languages/python/install/ - Use GIT to download the project you want.
- Create your own version of the database table contacts:

Note the “AUTO_INCREMENT” for the ID field. This field is used as the unique ID for every row, and can be used for unambiguously refering to a record when changing or deleting. The “AUTO_INCREMENT” attribute assigns unique inter values for each record in a sequence. To do this click the “A_I” box for the field (you must scroll to the right to see it). This check box is avalable both then creating the table, and when editing the structure.
6. In contactDB.h or contactApp.py to change USER, PASS, and DB to your username, password, and name of your Database
#define DB_URL "jdbc:mariadb://localhost:3306/whatever"
#define USER "kenyon"
#define PASS "GambierOwls"
or
USER = "<strong>kenyon</strong>"
DB = "<strong>kenyon</strong>"
PASS="<strong>GambierOwls</strong>"Code language: HTML, XML (xml)
Add a directory to your web directory:
(for python)
sudo mkdir /var/www/html/contactPy/sudo chown ubuntu /var/www/html/contactPy/
or
(for C++)
sudo mkdir /var/www/html/contactCpp/sudo chown ubuntu /var/www/html/contactCpp/
Make the system and run:
(for c++)
make
./contactApp
or
(for python)
./start.sh
Add some records to the system and test it!
