===== Introduction ===== To run niota, you need a [[niota_glossary|MySQL]] [[niota_glossary|DBMS]] to which you add the metadata database ([[niota_glossary|N-MDDB]]). It depends on the requirements of your IT department which way you have to choose to set up N-MDDB. The possible options are. * "A" install a dedicated niota MySQL server with a pre-installed N-MDDB * "B" install a dedicated MySQL server and add the N-MDDB * "C" add a pre-configured N-MDDB to an existing MySQL server * "D" create new N-MDDB from MySQL scripts (the hard way) Please check [[niota_requirements|system requirements]] for valid combinations of niota application and MySQL server. ---- ===== ''A'' install MySQL DBMS with predefined N-MDDB ===== Download the MySQL Server from the [[niota-docs:niota_links|niota download page]]. The download contains a portable MySQL server with a pre-installed empty N-MDDB. You can use this to set up niota very quickly. ** Please check the version of the meta database included in this download ** It has to fit the required version of you niota web application. Continue with [[niota_install_meta_Windows| Windows - set up MySQL]].\\ ===== ''B'' install MySQL DBMS ===== Download the MySQL version from the official download page and copy the unzipped folder to target location on your server. Check [[niota-docs:niota_requirements|System Requirements niota]] for highest supported MySQL version. Continue with [[niota_install_meta_Windows| Windows - set up MySQL]].\\ Then continue with option C or D ===== ''C'' add/restore N-MDDB to a MySQL DBMS ===== If as MySQL server is already up and running you can add a metadata database to this server. Download the accessory tools or a provided empty metadata database backup from the [[niota_links|niota download page]]. Follow the steps listed [[niota_accessory_do_manage_metadb|here]] to add a metadata database to you MySQL DBMS. ===== ''D'' set up N-MDDB on a MySQL DBMS ===== Download the accessory tools for niota and run all the scripts to set up database step by step. In this accessory folder you can find a **''/bin''** folder where all the executables are stored. This is just in case you are not allowed to run a standalone MySQL server for niota or you want to set up database on our own. Read carefully the docu of the [niota_install_meta_manually|manual set up procedure]] and run it step by step. ==== Windows - setup MySQL ==== In case of upgrade to a new MySQL server version you can use only one MySQL server at the same time on the same port. In case you want the check how niota works with new MySQL server and then again switch back to old MySQL server you have to shut down always the other. **There must not be two server listening on the same port** If you want to run both server at the same time you can configure niota **''..\connections.php''** to switch from one server to the other. **Recommendation:** Remove the detailed version info from you target folder. e.g. rename “niota-meta-80_v2.1.21308” to “niota-meta_v2” * navigate to the mysql- - folder and check the configured port in configuration file my.ini Default port 3306 is configured. If you have to change this, then set your desired port number here. If you change the port for N-MDDB you must edit also your **''..\connections.php''** file in N-PAPP and set this port number here as well. * set your ''data'' directory. In case nothing is set, data directory will be placed directly under the /data. If you want to change this, add the datadir= setting to you my.ini file. * open windows command prompt in admin mode * navigate to your mysql-folder into the \bin\ - subfolder * initialize your data directory by ''mysqld --console --initialize'' * run command: mysqld --install [mysqld] datadir="C:/MySQLFarm/niota-meta-v3/data/" log_bin_trust_function_creators=1 port=3367 character-set-server = utf8mb4 log_bin_trust_function_creators = 1 [client] port=3367 ...\bin> mysqld --initialize --console After this you my find a lot of files in our data folder and a generated password for your local root user. something like this..... 2025-05-04T13:03:37.806731Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. 2025-05-04T13:03:38.163275Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. 2025-05-04T13:03:40.008905Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: T5:und.yAQXe This root password is a one time password and is not valid to sign in. It can only be used to set the password to a new password. Use command "mysql_secure_installation" to set the password. Tool "mysql_secure_installation" uses ''[client]'' parameter - section from ''my.ini'' configuration file **Take care to run mysql server either as service or in console mode when you start ''mysql_secure_installation''. This tool needs an up and running MySQL Server** ...\bin\mysql_secure_installation * change your password to a secure password * remove all anonymous users * remove all test databases and access to it Now you should be able to sign in to then new MySQL DBMS via a client tool. To check this out start the mysqld in console mode and try to connect via a client tool like MySQL workbench or MariaDB or similar. **Recommendation:** Start N-MDDB in a console mode before you install it as a service. To achieve this run mysqld --console press CTRL+C to quit MySQL console mode If you could successfully log in to the MySQL server with root user and your newly set password the configuration is ready to be installed as a service. === Windows - install MySQL as service === ...\bin> mysqld --install MySQL_niota_610 **Recommendation:** Add the primary N-PAPP version number or/and the primary N-MDDB version to the service name. So possible servicenames would be * ''MySQL_niota_402'' --- niota php-application 4.0.x * ''MySQL_niota_411'' --- niota php-application 4.1.x * ''MySQL_niota_610'' --- niota php-application 6.1.x **In case install as a service is denied, it is most likely that you have not started command window in administration mode!!!** Install/Remove of the Service Denied! This naming conventions can be useful if you want to upgrade N-PAPP to a higher release and run the active release and the next release in parallel. * Set description of service with sc (service control manager) command * run command: sc description "description" ...\bin>sc description MySQL_niota_610 "niota 6.1.x metadata" * go to windows services and start the service * verify that newly installed service switches to "Running" status and keeps running ...\bin>sc start MySQL_niota_v610 {{:niota-docs:pasted:20250508-145111.png}} === remove MySQL service === * stop MySQL service * run command prompt in admin mode * run command: sc delete ServiceName or * navigate to “/bin” folder of that MySQL folder which service you would like to remove (e.g.: “Apache24x64\htdocs\niota\db\mysql-5.7\bin\”) * run command: mysqld –-remove MySQL_niota