Database Server Installation & Setup

From ADempiere ERP Wiki
Jump to navigationJump to search

Table of Contents#System Administrator's Guide{{#if: Installation Steps| | Installation Steps }}{{#if: | | [[{{{3}}}]] }}{{#if: | | [[{{{4}}}]] }}{{#if: | | [[{{{5}}}]] }} | Database Server Installation & Setup{{#if: Application Server Installation & Setup| | Application Server Installation & Setup }} ⇒

ADempiere can work with a number of databases. Install the database according to its own instructions. The following sections provide hints and tips on configuring the database to work with ADempiere.

PostgreSQL Installation & Setup[edit]

It is recommended that you read the PostgreSQL Manuals carefully. There are many useful tips and tricks in the documentation and user comments.

If you use the Postgres Windows Installer, many of the following steps will be done for you by the installer but you will have to pay attention to the security settings.

The following is from the PostgreSQL installation guide after the software has been built and installed from source.

Create a unpriviledged user on the database server computer that is unique to the PostgreSQL installation and has sole access to/ownership of the data the database creates but little else. Don't use this user to install the software but ensure the PostgreSQL server daemon runs under this account. The user "postgres" is a common choice.

Log in as the "postgres" user and create the database cluster - a group of databases. This is done by defining the location where the databases will be stored. This can be anywhere on the file system. The cluster is created with the command initdb which comes with PostgreSQL. The format is

$ initdb -D /usr/local/pgsql/data

where /usr/local/pgsql/data is the location of the database cluster. As an alternative to the -D option, the environment variable PGDATA can be defined.

Note.gif Note:

If the postgres user is unpriviledged, the initdb command may not be able to create the data directory if it doesn't already exists. In that case, log in as root/administrator and create the data directory before you run the command as the postgres user. The initdb command will remove all access permissions to the data directory for everyone but the postgres user. See the PostgreSQL manuals for additional security settings.

It is important to properly set up the pg_hba.conf file to ensure the ADempiere application server can talk with the database. Remote TCP/IP connections will not be possible until this file is modified since the default behavior is to listen for TCP/IP connections only on the local loopback address "localhost". When the application server and the database server are separate machines, the pg_hba.conf file must be set to allow connections from the application server. For security, use as restrictive a connection as possible.

Follow the instructions to start the database server.

Note.gif Note:

The ADempiere application utility scripts need access to the psql command from the application server machine. You may need to install an empty version of PostgreSQL on the ADempiere application server or, at least, a copy of the necessary binary executable files.

Move on to Application Server Installation & Setup.

Oracle Installation & Setup[edit]

Oracle installation is straight forward. Follow the instructions in the Oracle documentation.

Note.gif Note:

The Oracle XE version (Express Edition) is available for free but there are limitations on its use in terms of maximum database size, number of running instances allowed, amount of RAM used, number of CPUs used to process queries (only 1 used) and a lack of https support. While these limitations are acceptable for demonstrations and development, use in production and multi-user environments is not recommended. Please review the Oracle Database Express Edition documentation on Licensing Restrictions prior to making your choice. If you require Oracle, consider purchasing licenses for the Standard Editions.

Move on to Application Server Installation & Setup.

MySQL Installation & Setup[edit]

Note.gif Note:

ADempiere integration with MySQL requires developer support. Please verify in the repository and forums if MySQL is supported by the version of ADempiere you wish to use.

This section from Naquib13. He is documenting from Trifon's SF thread.

  • MySQL 5.x I recommend using Workbench
  • Do the following after installing the above:
  1. Change my.cnf file.
  2. Set tables names to be lower case.
  3. Enable recursive stored procedures.
  4. Enable MySQL ANSI mode. $ sudo vim /etc/mysql/my.cnf lower_case_table_names=1 max_sp_recursion_depth=128 sql_mode='ANSI'
  5. Restart MySQL server $ sudo /etc/init.d/mysql restart
  6. Create "adempiere" database $ mysql -u root -p mysql>create database adempiere DEFAULT CHARACTER SET = utf8 DEFAULT COLLATE = utf8_bin;
  7. Create "adempiere" MySQL DB user $ mysql -u root -p mysql> GRANT ALL ON adempiere.* TO 'adempiere'@'localhost' IDENTIFIED BY 'adempiere';
  8. Import Initial MySQL DB Seed(ADempiere version 3.6.0LTS) $ mysql -u adempiere -p -h localhost adempiere < <ADEMPIERE_HOME>/data/Adempiere_mysql.dmp
  9. Follow standard ADempiere installation process $ <ADEMPIERE_HOME>/
  10. Start ADempiere Server $ <ADEMPIERE_HOME>/utils/
  11. Start ADempeire Swing client $ <ADEMPIERE_HOME>/

Move on to Application Server Installation & Setup.