It is currently Sun Jun 16, 2019 3:52 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: RE: New UseMySQLDatabase() in 5.70
PostPosted: Sun Dec 09, 2018 7:11 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 801
Location: Cuernavaca, Mexico
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?

_________________
- It was too lonely at the top.


Top
 Profile  
Reply with quote  
 Post subject: Re: RE: New UseMySQLDatabase() in 5.70
PostPosted: Sun Dec 09, 2018 7:28 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 9:27 pm
Posts: 197
Location: Kent, UK
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

_________________
Regards

Andy

Image
Registered PB & PureVision User


Top
 Profile  
Reply with quote  
 Post subject: Re: RE: New UseMySQLDatabase() in 5.70
PostPosted: Sun Dec 09, 2018 7:51 pm 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4232
Location: Germany
https://mariadb.com/kb/en/library/create-database/


Top
 Profile  
Reply with quote  
 Post subject: Re: RE: New UseMySQLDatabase() in 5.70
PostPosted: Sun Dec 09, 2018 8:10 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 801
Location: Cuernavaca, Mexico
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 ? :?

_________________
- It was too lonely at the top.


Top
 Profile  
Reply with quote  
 Post subject: Re: RE: New UseMySQLDatabase() in 5.70
PostPosted: Sun Dec 09, 2018 9:55 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Fri Apr 25, 2003 4:34 pm
Posts: 888
Location: Canada
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.

_________________
Image Image


Top
 Profile  
Reply with quote  
 Post subject: Re: RE: New UseMySQLDatabase() in 5.70
PostPosted: Mon Dec 10, 2018 7:56 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4232
Location: Germany
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)


Top
 Profile  
Reply with quote  
 Post subject: Re: RE: New UseMySQLDatabase() in 5.70
PostPosted: Mon Dec 10, 2018 2:49 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 2:15 pm
Posts: 801
Location: Cuernavaca, Mexico
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}

_________________
- It was too lonely at the top.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye