Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
README.md
a_hello
a_hello.erl
b_raw
b_raw.erl
c_rows_as_records
c_rows_as_records.erl
d_prepared_statement
d_prepared_statement.erl
e_stored_procedure
e_stored_procedure.erl

README.md

Emysql Samples

Sample programs are in ./samples.

Running Samples

1. Build Emysql

Build emysql.app, using make:

$ cd Emysql
$ make

2. Make a Sample Database

For use in the above sample (and all of those below, too), create a local mysql database. You should have a mysql server installed and running:

$ mysql [-u<user> -p]
mysql> create database hello_database;
mysql> use hello_database;
mysql> create table hello_table (hello_text char(20));
mysql> grant all privileges on hello_database.* to hello_username@localhost identified by 'hello_password';

3. Running the Samples

$ cd samples
$ ./a_hello
$ ./b_raw
$ ./c_rows_as_records
$ ./d_prepared_statement
$ ./e_stored_procedure

or make emysql.app and the database, as explained above, and start a_hello etc. manually along these lines:

$ make
$ cd samples
$ erlc a_hello.erl
$ erl -pa ../ebin -s a_hello run -s init stop -noshell
Something went wrong with that request. Please try again.