Documentation

MySQL: Difference between revisions

 
Line 13: Line 13:
* Create a new empty database “target3001db” (with collation utf8mb3_general_ci) with phpMyAdmin, for example, or in the SQL console:
* Create a new empty database “target3001db” (with collation utf8mb3_general_ci) with phpMyAdmin, for example, or in the SQL console:
  CREATE DATABASE target3001db CHARACTER SET utf8 COLLATE utf8_general_ci;
  CREATE DATABASE target3001db CHARACTER SET utf8 COLLATE utf8_general_ci;
* Download the following SQL file and import it into the new empty database: '''[https://office.ibfriedrich.com/target3001db.sql target3001db.sql]''' (100 MB). All tables, all functions and all triggers are created automatically.
* Download the following SQL file in a ZIP and import it into the new empty database: '''[https://office.ibfriedrich.com/target3001db.zip target3001db.zip]''' (60 MB). All tables, all functions and all triggers are created automatically.
* Enter users and rights for the new database. User names and passwords may have a maximum of 16 characters each. The following rights are required: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE and TRIGGER.
* Enter users and rights for the new database. User names and passwords may have a maximum of 16 characters each. The following rights are required: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE and TRIGGER.
* In TARGET in the component browser in the “Connected to...” menu enter the settings for MySQL. These are also used for MariaDB:
* In TARGET in the component browser in the “Connected to...” menu enter the settings for MySQL. These are also used for MariaDB:

Latest revision as of 15:54, 22 January 2025

SQLiteMySQL
SQLiteMySQL



Have a look at the article Component database as well.

MySQL / MariaDB: The fast database for multiple workstations

The SQLite component database pre-installed with TARGET becomes slow with normal network transfer rates in multi-user operation. If you want to access a shared TARGET 3001! component database in a network with several workstations, you need the components in a ‘’‘MySQL database’‘’ or in a ‘’‘MariaDB’‘’. In our experience, however, the SQLite database has the edge in single-user operation.

Install MySQL / MariaDB

You can download the installers here: MySQL and MariaDB

You can install the database on a PC or on a server.

Set up / customize MySQL / MariaDB server and insert TARGET database

  • Create a new empty database “target3001db” (with collation utf8mb3_general_ci) with phpMyAdmin, for example, or in the SQL console:
CREATE DATABASE target3001db CHARACTER SET utf8 COLLATE utf8_general_ci;
  • Download the following SQL file in a ZIP and import it into the new empty database: target3001db.zip (60 MB). All tables, all functions and all triggers are created automatically.
  • Enter users and rights for the new database. User names and passwords may have a maximum of 16 characters each. The following rights are required: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE and TRIGGER.
  • In TARGET in the component browser in the “Connected to...” menu enter the settings for MySQL. These are also used for MariaDB:
Start TARGET with MySQL database <enter “Yes” here>
MySQL Server <name or IP of your MySQL/MariaDB server>
MySQL User <your user name for the MySQL/MariaDB server>
MySQL Password <your corresponding password>
MySQL SSH Key <if SSH is used: SSH key file>
MySQL SSH Cert <if SSH is used: Certificate-File>
MySQL SSH CA <if SSH is used: Certificate-Authority-File>
  • If you have already created your own user components in the SQLite database, you can execute the menu item “Connected to... / Migration from SQLite to MySQL...” once and select the SQLite database ‘target3001.db’. The synchronization may take a moment. Additional *.db files can be imported later in the “Import / Export” menu.
  • To be on the safe side, you can call up the “Update” menu item again in the component browser.

Particularities for Windows servers

Necessary for Windows servers (with the console):

$ mysql -u root -p
or without password: $ mysql -u root
mysql> use mysql
mysql> GRANT ALL ON *.* to root@'%' IDENTIFIED BY '<your-mysql-root-password>';
mysql> FLUSH PRIVILEGES;

You can also make this setting with phpMyAdmin or with the Workbench.

Does MS-SQL also work instead of MySQL or MariaDB?

MS-SQL unfortunately does not work.

Help, MySQL throws error messages!

If TARGET can no longer connect to the database or throws other error messages, this may be due to deleted users. If necessary, recreate these users in the MySQL database.