PureBasic Forum
http://forums.purebasic.com/english/

RE: New UseMySQLDatabase() in 5.70
http://forums.purebasic.com/english/viewtopic.php?f=13&t=71897
Page 1 of 1

Author:  blueb [ Sun Dec 09, 2018 7:11 pm ]
Post subject:  RE: New UseMySQLDatabase() in 5.70

Trying out the new commands in 5.70....

I can create 'tables' in MariaDB, but have no luck when I try to create a 'database' in MariaDB (MySQL)


Using the SQLite method... does not apply to MariaDB.
If CreateFile(0, DatabaseFile$)
CloseFile(0)
endif


I believe I can create a database using HeidiSQL (included with MariaDB)... but how to do this with PureBasic?

Author:  Ajm [ Sun Dec 09, 2018 7:28 pm ]
Post subject:  Re: RE: New UseMySQLDatabase() in 5.70

Mysql is not a file based database like SQLite. You will need to issue a create database statement in the same way you issue create table statements. e. g CREATE DATABASE test

Regards

Andy

Author:  infratec [ Sun Dec 09, 2018 7:51 pm ]
Post subject:  Re: RE: New UseMySQLDatabase() in 5.70

https://mariadb.com/kb/en/library/create-database/

Author:  blueb [ Sun Dec 09, 2018 8:10 pm ]
Post subject:  Re: RE: New UseMySQLDatabase() in 5.70

Thanks fellas... that helps.

Quote:

UseMySQLDatabase() which use the opensource libmariadb.dll (found in purebasic\compilers\ dir) and brings MySQL and MariaDB support natively to PureBasic ! (sponsored by Paul)


Regarding the file libmariadb.dll
Quote:
When shipping your PureBasic program, you will need to add 'libmariadb.dll' (Windows), 'libmariadb.so' (Linux) or 'libmariadb.dylib' (OSX) found in the 'PureBasic/Compilers' directory to your package.

There is no additional driver to install, all is ready to connect a MySQL or MariaDB server.


If I include it with my 'compiled' program, can I create a database file, etc. with my executable and have it all in one folder? Or do I need to have the user install MariaDB? Or at least MariaDB Connector/C ? :?

Author:  Paul [ Sun Dec 09, 2018 9:55 pm ]
Post subject:  Re: RE: New UseMySQLDatabase() in 5.70

blueb wrote:
Thanks fellas... that helps.

If I include it with my 'compiled' program, can I create a database file, etc. with my executable and have it all in one folder? Or do I need to have the user install MariaDB? Or at least MariaDB Connector/C ? :?


The SQLite database format requires you to create a file on your hard drive and then the database is built by accessing that file.

MariaDB/mySQL or PostgreSQL require database servers to be installed somewhere, either local or remote. You then connect to those servers using the PB Database commands.
If your app uses these formats then the end user must have the appropriate database server software installed.

Author:  infratec [ Mon Dec 10, 2018 7:56 am ]
Post subject:  Re: RE: New UseMySQLDatabase() in 5.70

If your user want's to access a web server, then the web server have to run somewhere.
If he needs a private web server at his PC he have to install a web server.
If he want's to access a 'public' web server via the internet this server must be up and running.

Same as for a database which is accessable via the internet.

And no, when ths database server is in the internet, then the user needs only the dll beside the exe.

And I alreday made some feature requests that TLS has to be working for all network related stuff.
Also for database access.

As a workarround I programmed a PostgreSQL SSL Proxy (TLS)

Author:  blueb [ Mon Dec 10, 2018 2:49 pm ]
Post subject:  Re: RE: New UseMySQLDatabase() in 5.70

Paul wrote:
... MariaDB/mySQL or PostgreSQL require database servers to be installed somewhere, either local or remote. You then connect to those servers using the PB Database commands.
If your app uses these formats then the end user must have the appropriate database server software installed.


Wishfully thinking that maybe the DLL would provide the same benefits of Firebird's Embedded Server.

see: https://www.firebirdsql.org/manual/fbmetasecur-embedded.html

Other than that, MariaDB was extremely easy to use and install. I may transition from Postgres. {grin}

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/