This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
db_command_tutorial [2015/05/22 09:27] stephdl [Change values of properties] |
db_command_tutorial [2019/06/05 19:48] (current) |
||
---|---|---|---|
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:// | 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:// | ||
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 a 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. |
+ | <WRAP center round alert 60%> | ||
+ | **The signal-event | ||
+ | </ | ||
<WRAP center round tip 60%> | <WRAP center round tip 60%> | ||
Line 21: | Line 24: | ||
The database system is based on a flat file system, but you should never edit them directly. Instead you should use the db command. More details on using the database system can be found in the [[http:// | The database system is based on a flat file system, but you should never edit them directly. Instead you should use the db command. More details on using the database system can be found in the [[http:// | ||
+ | =====Auto completion===== | ||
+ | |||
+ | Like in every Linux shell you can use the TAB key when you use the command line to auto complete or propose all available answers | ||
=====Usage===== | =====Usage===== | ||
Line 26: | Line 32: | ||
Use of ' | Use of ' | ||
</ | </ | ||
+ | ====Keys/ | ||
+ | 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 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | Apply the above " | ||
+ | |||
+ | Note that missing (or no) properties and values do not necessarily mean no value is in the / | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | Look in / | ||
+ | and subfolders and template fragments applicable to particular / | ||
+ | |||
+ | |||
+ | ====show all available databases==== | ||
+ | To show a list of existing databases do | ||
+ | ls -al / | ||
+ | |||
+ | To show the keys for the two main databases do: | ||
+ | db configuration show |less | ||
+ | That can be abbreviated to | ||
+ | config show |less | ||
+ | |||
+ | db accounts show |less | ||
+ | |||
+ | Note after using the |less switch, press Enter to scroll down a line at a time, or press Space to scroll down a page at a time. ' | ||
====Create a key in a database==== | ====Create a key in a database==== | ||
the generic command is : | the generic command is : | ||
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/ |
key : the name of key | key : the name of key | ||
type : generally ' | type : generally ' | ||
Line 56: | Line 98: | ||
The generic command line is | The generic command line is | ||
db dbfile setprop key prop1 val1 [prop2 val2] [prop3 val3] ... | db dbfile setprop key prop1 val1 [prop2 val2] [prop3 val3] ... | ||
- | | + | |
- | dbfile : choose the database in /home/e-smith/db | + | |
+ | dbfile : choose the database in /var/lib/ | ||
key : the name of key | key : the name of key | ||
Line 139: | Line 182: | ||
for example | for example | ||
- | db configuration setprop plop WpLang | + | db configuration setprop plop WpLang '' |
or | or | ||
- | config setprop plop WpLang | + | config setprop plop WpLang '' |
<WRAP center round tip 60%> | <WRAP center round tip 60%> |