Difference between revisions of "Connect to a database"

From wikieduonline
Jump to navigation Jump to search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
* [[MariaDB]]: <code>[[mysql (command)|mysql]]</code>
+
* [[MariaDB]]:  
 +
** <code>[[mysql (command)|mysql]]</code>
 +
** <code>[[mysql (command)|mysql]] NameOfYourDB</code>
 
* [[PostgreSQL]]: [[psql]]:  
 
* [[PostgreSQL]]: [[psql]]:  
 
** <code>[[sudo -u postgres psql]]</code>
 
** <code>[[sudo -u postgres psql]]</code>
 
** <code>[[psql service=MyConfiguredDB]]</code> <code>([[$HOME/.pg service.conf]])</code>
 
** <code>[[psql service=MyConfiguredDB]]</code> <code>([[$HOME/.pg service.conf]])</code>
** <code>\c name_of_db</code> or <code>[[\connect]] name_of_db</code>
+
** <code>\c name_of_db</code>
 +
** <code>[[\connect]] name_of_db</code>
 
* [[MongoDB]]: <code>[[mongo]]</code>, <code>[[use]] DB_NAME</code>
 
* [[MongoDB]]: <code>[[mongo]]</code>, <code>[[use]] DB_NAME</code>
  
  
 +
== Related ==
 +
* <code>[[SELECT current database();]]</code>
  
== Related terms ==
 
* <code>[[\c]]</code> databasename
 
  
 
== See also ==
 
== See also ==

Latest revision as of 07:04, 17 February 2023

Advertising: