To connect to mysql database:
- Make sure your mysql server is not bound to localhost - even local connections are via hostname
- Make sure you can connect to mysql server.. grant at least select privs using "grant select on db.* to 'test'@'hostname' identified by 'test';" NOTE: localhost privs are not enough - connection thru hostname.
- Do "export MYSQL_SERVER=hostname"
- Set/export the following environment variables:
A4GL_SQLUID=test #whatever connection user isAnd now take the simple.4gl program:
A4GL_SQLPWD=test #whatever connection password is
database test # of whatever your database name is
display "Hello World"
Compile with : aubit 4glpc simple.4gl -o simple.4ae
If it compiles - database connection is ok!
Thanks to Mike's comment below - using .aubit4gl.acl to store database:user:pw DOES work.. just be sure to "unset A4GL_SQLUID" and "unset A4GL_SQLPWD".