A simple application to demonstrate CMake and pkg-config for libmysqlclient.
- CMake
- MySQL client library >= 5.7
$ docker-compose up -d
$ docker-compose exec client bash
root@fa4a2a76d818:/app# ./build/hello
Hello, MySQL World! Let's start by connecting to the database.
Server name: db
Server port: 3306
User name: root
Password: test
Database:
You're now connected to the server.
Query (or 'quit'): create database foo;
No result.
Query (or 'quit'): create table foo.bar (id int, name varchar(10));
No result.
Query (or 'quit'): insert into foo.bar values (1, 'Mike');
No result.
Query (or 'quit'): insert into foo.bar values (2, 'John');
No result.
Query (or 'quit'): select * from foo.bar;
[1] [Mike]
[2] [John]