User Tools

Site Tools


db_command_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
db_command_tutorial [2015/05/22 11:32]
stephdl [Usage]
db_command_tutorial [2015/05/22 11:58]
stephdl
Line 1: Line 1:
-===== Database variables ​=====+===== Db command tutorial ​=====
  
 NethServer comes with the most used parameters set as variables in its internal configuration databases. These variables are used to store values to be used in the final configuration files. Please, read the [[http://​docs.nethserver.org/​projects/​nethserver-devel/​en/​latest/​databases.html|Database howto]], the [[http://​docs.nethserver.org/​projects/​nethserver-devel/​en/​latest/​templates.html|template howto]] and the [[http://​docs.nethserver.org/​projects/​nethserver-devel/​en/​latest/​events.html#​signalling-events|event howto]] to understand the template and database process. NethServer comes with the most used parameters set as variables in its internal configuration databases. These variables are used to store values to be used in the final configuration files. Please, read the [[http://​docs.nethserver.org/​projects/​nethserver-devel/​en/​latest/​databases.html|Database howto]], the [[http://​docs.nethserver.org/​projects/​nethserver-devel/​en/​latest/​templates.html|template howto]] and the [[http://​docs.nethserver.org/​projects/​nethserver-devel/​en/​latest/​events.html#​signalling-events|event howto]] to understand the template and database process.
Line 12: Line 12:
   signal-event nethserver-php-save   signal-event nethserver-php-save
  
-The first line changes the value for the memory limit of PHP, the second line regenerates the configuration file and the last line will reload Apache (and subsequently also PHP as this is configured as module of Apache). +The first line changes the value for the memory limit of PHP, the second line regenerates the configuration file and restart apache. **The signal-event ​is a mandatory to apply the modification**
 <WRAP center round tip 60%> <WRAP center round tip 60%>
 Database parameters are case sensitive so take great care when typing at the server shell because no error messages are given should you make a typo. Database parameters are case sensitive so take great care when typing at the server shell because no error messages are given should you make a typo.
Line 29: Line 28:
 Use of '​config'​ is a shorthand version for 'db configuration'​ and therefore only works with the configuration database Use of '​config'​ is a shorthand version for 'db configuration'​ and therefore only works with the configuration database
 </​WRAP>​ </​WRAP>​
 +====Keys/​Properties/​values====
 +
 +All turn around A key with properties and values of the properties, no more, no less. You can have a lot of properties under a key which is unique
 +
 +  # db configuration show passwordstrength ​   <- database => configuration
 +   ​passwordstrength=configuration ​            <- Key (type = configuration) ​
 +     ​Admin=strong ​                            <- property (value = strong)
 +     ​Ibays=strong ​                            <- property (value = strong)
 +     ​MaxPassAge=180 ​                          <- property (value = 180)
 +     ​MinPassAge=0 ​                            <- property (value = 0)
 +     ​PassExpires=yes ​                         <- property (value = yes)
 +     ​PassWarning=7 ​                           <- property (value = 7)
 +     ​Users=strong ​                            <- property (value = strong)
 +
 +
 +Apply the above "​reasoning"​ to any database and the the syntax presented by issuing db then makes sense.
 +
 +Note that missing (or no) properties and values do not necessarily mean no value is in the /​etc/​file.conf system, as the template code can have a default value in the absence of a specific db value.
 +
 +Note to determine what db settings are supported by sme code, or what the default values are, refer to (ie read) the code that is in the particular template or custom template associated with a /​etc/​file.conf
 + 
 +Look in /​etc/​e-smith/​templates/​... and /​etc/​e-smith/​templates-custom/​....
 +and subfolders and template fragments applicable to particular /​etc/​file.conf configuration files.
 +
  
 ====show all available databases==== ====show all available databases====
Line 46: Line 69:
   db dbfile set key type [prop1 val1] [prop2 val2] ...   db dbfile set key type [prop1 val1] [prop2 val2] ...
  
-  dbfile : choose the database in /home/e-smith/db+  dbfile : choose the database in /var/lib/​nethserver/db/
   key : the name of key   key : the name of key
   type : generally '​service'​ or '​configuration'​ but it can be other things as webbapps or url or ...   type : generally '​service'​ or '​configuration'​ but it can be other things as webbapps or url or ...
Line 73: Line 96:
  
  
-  dbfile : choose the database in /home/e-smith/db+  dbfile : choose the database in /var/lib/​nethserver/db/
   key : the name of key   key : the name of key
  
Line 155: Line 178:
  
 for example for example
-  db configuration setprop plop WpLang ​<​nowiki>​''​</​nowiki>​+  db configuration setprop plop WpLang ''​
 or or
-  config setprop plop WpLang ​<​nowiki>​''​</​nowiki>​+  config setprop plop WpLang ''​
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
db_command_tutorial.txt · Last modified: 2019/06/05 21:48 (external edit)