User Tools

Site Tools


db_command_tutorial

Differences

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

Link to this comparison view

db_command_tutorial [2015/05/22 09:13]
stephdl
db_command_tutorial [2019/06/05 19:48]
Line 1: Line 1:
-== Database variables == 
  
-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 and to understand the template and database process. 
- 
-These variables are useful to configure your system more easily, as you do not need to modify configuration files directly for most common cases. It also makes it possible to administer the server through its server-manager as the database variables are used to set and change configuration parameters.  After editing, the configuration files must be regenerated and affected services need to be restarted. 
- 
-For example, suppose you need to increase "memory-limit" in php. 
- 
-You would simply execute these commands at the server console: 
- 
-  db configuration setprop php MemoryLimit 64 
-  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). 
- 
-<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. 
-</WRAP> 
- 
- 
-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://mirror.contribs.org/smeserver/contribs/gordonr/devguide/html/devguide.html#SME-INTERNALS SME Server Developer's Guide]. 
- 
- 
-=== Setting db variables to default values === 
-<WRAP center round tip 60%> 
-Use of 'config' is a shorthand version for 'db configuration' and therefore only works with the configuration database 
-</WRAP> 
-  
- 
-Any db variable that has a default value can be reset to the default by deleting the variable entirely, then re-initializing the default database values as follows: 
-  config delprop <key> <prop> 
-  /etc/e-smith/events/actions/initialize-default-databases 
- 
-==== Delete a property value ==== 
-To delete the property 
-  db accounts delprop <key> <prop> 
- 
-==== Reset a property value ==== 
-To reset to an empty value 
-  db accounts setprop <key> <prop> <nowiki>''</nowiki> 
- 
- 
-{{tag> neth-howto }} 
db_command_tutorial.txt ยท Last modified: 2019/06/05 19:48 (external edit)