I need to connect with database server lazarus / 63-Database ---------------------------------------------------------------------- Gebony · 2019-05-20 12:23 I want  to connect to database server not to the database itself. or I want to program database server management tool. How can I do this? ---------------------------------------------------------------------- rvk · 2019-05-20 12:31 Which server? What do you actually want to achieve? ---------------------------------------------------------------------- Gebony · 2019-05-20 12:34 postgres and mariadb or mysql. I want program tool like HeidiSQL or pgadmin but for desktop. ---------------------------------------------------------------------- rvk · 2019-05-20 12:54 Quote from: Gebony on May 20, 2019, 02:34:28 pmpostgres and mariadb or mysql. I want program tool like HeidiSQL or pgadmin but for desktop. So... you don't need to connect to the engine without a database. All these tools are made that you first need to 'register' a database with the tool. Before that registration, there is no connection needed yet. After that you can just list all registered databases and connect to them with the normal connect command. If are some databasemanagers made in Lazarus, so you can look at them how it's done. ---------------------------------------------------------------------- Leledumbo · 2019-05-20 22:18 Lazarus ships with one standalone database desktop tool, check your tools folder. ---------------------------------------------------------------------- Gebony · 2019-05-21 12:08 but these tools don't need to register but browse the databases and create database if you need to . ---------------------------------------------------------------------- rvk · 2019-05-21 13:23 Quote from: Gebony on May 21, 2019, 02:08:51 pmbut these tools don't need to register but browse the databases and create database if you need to . Yes, for MySQL (and MariaDB) you are correct. You can use SHOW DATABASES to show the available databases. But you still need to supply ONE databaseame to connect. You can use the mysql-databasename for that. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i MySQLConnection1.DatabaseName := 'mysql'; // MySQL is allways there!See the example here: http://wiki.freepascal.org/MySQLDatabases#Connect_to_a_server QuoteThis database is used by mysql for some housekeeping so it will always be there. ---------------------------------------------------------------------- Gebony · 2019-05-21 13:25 thank you I saw it in the wikisite,but I need the same for postgresql too. ---------------------------------------------------------------------- rvk · 2019-05-21 14:26 Quote from: Gebony on May 21, 2019, 03:25:50 pmthank you I saw it in the wikisite,but I need the same for postgresql too. And what databasemanager do you know can do this, which can also handle postgresql? Some database just don't have the ability to show known databases. I know Firebird can't do it. I don't think postgresql can either. ---------------------------------------------------------------------- Thaddy · 2019-05-21 14:58 Quote from: rvk on May 21, 2019, 04:26:48 pmQuote from: Gebony on May 21, 2019, 03:25:50 pmthank you I saw it in the wikisite,but I need the same for postgresql too. And what databasemanager do you know can do this, which can also handle postgresql? Some database just don't have the ability to show known databases. I know Firebird can't do it. I don't think postgresql can either. You are absolutely right: Most can't do it. Indeed. Older versions of most, however, would have worked in the past. The issue is simply security related and so would only work with a secure connection (in the case of mysql/mariadb: indeed a proper login to at least one, if it isn't proxied out of sight, that is) Also known as separation of interest: access should be on a per database basis -or even on a more finely grained level like Oracle supports- , not everything the server actually hosts: that should never be available all at once. ---------------------------------------------------------------------- Zvoni · 2019-05-22 14:50 Quote from: rvk on May 21, 2019, 04:26:48 pm And what databasemanager do you know can do this, which can also handle postgresql? Some database just don't have the ability to show known databases. I know Firebird can't do it. I don't think postgresql can either. Anyone ever heard of DBeaver? ---------------------------------------------------------------------- Thaddy · 2019-05-22 14:54 Quote from: Zvoni on May 22, 2019, 04:50:04 pm Anyone ever heard of DBeaver? Yes. Has the same restrictions as I described..... (for the same reasons) Maybe I forgot to explain: over the web, not over a lan or tunneled. ---------------------------------------------------------------------- rvk · 2019-05-22 15:00 Quote from: Zvoni on May 22, 2019, 04:50:04 pmQuote from: rvk on May 21, 2019, 04:26:48 pm And what databasemanager do you know can do this, which can also handle postgresql? Some database just don't have the ability to show known databases. I know Firebird can't do it. I don't think postgresql can either. Anyone ever heard of DBeaver? I have. And are you saying DBeaver can list all available databases on the postgresql server without first registering such a database??? So you can just connect to a postgresql databaseserver and it will magically list all databases it knows? (If not, please read this topic carefully) Look at the image below. You would need to "Register" any postgresql database you want to work with first in DBeaver. Quote from: Thaddy on May 22, 2019, 04:54:15 pmMaybe I forgot to explain: over the web, not over a lan or tunneled. Does postgresql "publish" all it's available databases on the internal network/lan? (I know for certain Firebird doesn't). ---------------------------------------------------------------------- Thaddy · 2019-05-22 15:28 That's what I wrote too Rik... ---------------------------------------------------------------------- Zvoni · 2019-05-22 19:54 Ah, ok. Now i understand. Well, considering MySQL, that the User-Data needed for Login is actually stored in the "mysql"-DB, i agree: It makes no sense to connect to a DB-Server without at least specifying "mysql" (or in case of PG "postgres" (=Maintenance-DB)). So to connect to a server, the server itself has to store your credentials somewhere