Troubleshooting
Storing HMI recipe data in MySQL on an industrial PC
Short answer
Yes. Host MySQL on the industrial PC and read recipe rows from the HMI with its SQL Query object, keyed on the barcode's model number. Install MySQL 8.0 with the legacy authentication selection, run the account with all roles and privileges enabled, and gate go-live on a schema load, a simulator test and a field-by-field barcode read.
On this page
- Can an HMI recipe database live in MySQL on an industrial PC?
- How does the HMI read the right recipe row from the database?
- Why does the status register show error 1 while other SQL clients connect?
- Which MySQL version and authentication option should you install?
- Which privileges does the MySQL account need?
- How do you isolate an EasyBuilder Pro database connection fault?
- How large does a barcode-indexed recipe database get on the IPC?
- How do you verify the barcode-to-recipe transaction before go-live?
- Questions asked
Can a large HMI recipe set live in a MySQL database hosted on the plant's industrial PC? Yes. The HMI reads each recipe row over the network with its SQL Query object, keyed on the model number carried in the barcode, so the fixed recipe tables disappear along with the need to split them. In the reported project, an EasyBuilder Pro 6.08.02 build, every connection attempt failed while the status register returned error 1 and standalone SQL clients connected without trouble; the cause was the MySQL 9.0 installation, whose setup offered no legacy-authentication selection. Installing MySQL 8.0 with legacy authentication selected restored the connection, and an account with all roles and privileges completed the setup. The sections below give the architecture, the isolation order and the go-live checks.
Can an HMI recipe database live in MySQL on an industrial PC? #
Yes — MySQL runs as a normal Windows or Linux service on the industrial PC, and the HMI reads recipe rows over the plant network with its SQL Query object, so the barcode model number becomes a database lookup key instead of an HMI recipe index.
MySQL installs on the IPC and accepts clients from any address its accounts allow, which keeps the database and the panel independent: the PC can be replaced, backed up or rebuilt without touching the HMI project, and the recipe set grows by inserting rows rather than by adding another recipe database. EasyBuilder Pro documents both MySQL and MS SQL for this role. The connection lives in the project under [Objects] » [Database Server], with the server address, database name and account set on the General tab.
| Element | Role in the recipe path |
|---|---|
| Industrial PC | Hosts the MySQL service and the recipe schema |
| SQL Query object | Runs the queries and returns rows to the project |
| Barcode model number | The lookup key that selects one row |
| Recipe fields — dimensions, colors, styles, components | Columns returned with that row |
A model number works as a key because it is a string match rather than an index into a fixed-size table: model 5,001 is a new row, not a new recipe database.
How does the HMI read the right recipe row from the database? #
Configure the connection once in the project's Database Server settings — address, database name, account — then use the SQL Query object to run a SELECT whose WHERE clause matches the model number read from the barcode, and map the returned columns to HMI tags.
The schema load comes first: the project must read the table definitions from the server before any query can address columns, and in the reported failure that load was the step returning error 1. With Advanced mode enabled on the SQL Query object you write the statement yourself, which is what a barcode lookup needs — one SELECT whose WHERE clause compares the scanned value against the model-number column, with the returned columns mapped to the tags the machine logic consumes. Keep the query generic rather than hard-coded to any model, so adding a model means inserting a row, never editing the project.
Why does the status register show error 1 while other SQL clients connect? #
In the reported case the project could not load the table schema and the simulator could not connect, the status register returned error 1, and the help file's description for that number is 'unknown error' — the cause was the MySQL 9.0 server's authentication method, not the network.
A standalone client connecting successfully proves the service is listening and the password works. It does not prove that the server's authentication method is one the HMI's database client can negotiate, and that distinction was the whole fault: the reported test ran from the development PC against 127.0.0.1 as root, so the server, the credentials and the address were all provably fine while the handshake still failed. Error 1 is a symptom, not a diagnosis — the help file's own description is unknown error — so work the isolation list below before changing anything.
Which MySQL version and authentication option should you install? #
Install MySQL 8.0 and select the legacy authentication option during setup: in the reported failure the 9.0 installer offered no such selection, the HMI driver could not complete the handshake, and downgrading to 8.0 with legacy authentication selected restored both schema loading and simulator access.
The sequence with a confirmed result is: uninstall 9.0, install 8.0, and select the legacy authentication option during setup. The deciding fact is which authentication method the HMI's database integration expects, not which server release is newest; if a later installer offers the legacy selection again, test it and record the result for your site. Until the vendor documents the newer default method as supported for this integration, 8.0 with legacy authentication is the configuration to deploy.
Which privileges does the MySQL account need? #
The Database Server User manual's setup checklist requires an account with all roles and privileges enabled, and the reported case ran on the root account; a dedicated account with full rights scoped to the recipe database is the better long-term choice.
Step 9 of that manual is the checklist to walk, using the exact account the project uses, because the setup tests read table definitions and write rows that an under-privileged account cannot reach. Scope the grants to the recipe database itself rather than server-wide; when the same server later picks up a historian or logging duty, the six SQL rights for a historian database account shows how read, write and administrative grants separate cleanly.
How do you isolate an EasyBuilder Pro database connection fault? #
Work from the server outward and change one thing at a time: an independent client first, then privileges, then the authentication method, then the project's schema load, then the simulator — in the reported case the independent client passed while everything project-side failed, and the authentication method was the cause.
If even the independent client cannot open a connection, the fault is reachability rather than authentication, and the same server-side checks appear in the fix for a Node-RED client that cannot reach a remote MySQL database.
- Independent client — connect to the same server, database and account from a standalone SQL client. A pass clears the service, the credentials and the port in one step.
- Privileges — walk the privilege checklist in the Database Server User manual (step 9) for the account the project uses.
- Authentication method — confirm how the server was installed and whether the legacy selection was made; this is what the reported fix turned on.
- Schema load — reconnect from the project and confirm the table schema loads from the server.
- Simulator — run the project in the simulator against the same database before the panel goes live.
Change one item per pass and note what changed, so the eventual fix is attributable to a cause.
How large does a barcode-indexed recipe database get on the IPC? #
Worked example, illustrative: 40 recipe fields averaging 12 bytes give 40 × 12 = 480 bytes per model row, so 50,000 models occupy 480 × 50,000 = 24,000,000 bytes, about 24 MB — under 0.02 % of a 128 GB drive.
Run the multiplication with your own counts before you commit hardware: fields per row × bytes per field × model count. At ten times the example's row width the same 50,000 models occupy 240 MB, still a rounding error next to the operating system and logs, so capacity never decides the purchase. Decide on environment instead: the host must run MySQL as a 24/7 service inside the cabinet, which is the case for a fanless industrial mini PC mounted beside the controller, selected for its temperature rating, mounting style and solid-state storage. Give the server a fixed address and keep it on the same network segment as the panel.
How do you verify the barcode-to-recipe transaction before go-live? #
Test the whole machine transaction, not the schema load: scan a real barcode, read back the matching row, compare every returned field against the source record value by value, and only then release the recipe to the machine — a wrong row drives a real machine to build a wrong part.
Treat that comparison as the safety step it is: a recipe row becomes machine motion and product dimensions, and a mis-keyed lookup shows nothing wrong at the panel. Repeat the identical read on the target panel hardware, not only in the simulator — the reported fault lived in exactly that project-to-server path, and a simulator pass proves the SQL, not the panel. If operators edit recipes, write one controlled change back from the project, re-read the row with a fresh query, and confirm the database shows the edit, keeping the write path behind engineering-level access. Retire the split recipe databases only after the field-by-field read and the write-back round-trip both pass on the target hardware.
Questions asked
Can several HMIs and a SCADA host read the same MySQL recipe database at once?
Yes. MySQL is a multi-user server, so concurrent reads from more than one panel or a SCADA host are normal database behavior. Give each client its own account, keep recipe reads separate from other clients' writes, and expect row-level locking to serialize simultaneous edits rather than block readers. What matters at commissioning is that each client's connection is configured and tested separately, because a second panel does not inherit the first panel's tested configuration.
Does the project also push edited recipes back into MySQL, or only read them?
Both directions are documented. With Advanced mode enabled, the SQL Query object runs statements you write yourself, including the UPDATE that stores an edited recipe, and the SQL Sync feature is documented for syncing data to a central database. Keep the write path behind engineering-level access, then confirm every write with a fresh read of that same row, because a statement that reports success is not proof the values landed as intended.
What happens to a recipe read if the network link to the IPC goes down?
The reported evidence does not define runtime behavior during a network interruption, so design for it rather than assume it. Keep the last good recipe in local tags, alarm on a failed query, and block the next cycle until the row re-reads successfully. An alternative pattern is a small local recipe set holding only the models that line actually runs, with the MySQL database on the IPC as the master copy that feeds it.
Can the recipe database share the IPC with logging or a historian?
Yes, and at recipe-database sizes the shared load is negligible. Keep recipes in their own database on the server with their own account, so a rights change or a restore on the logging side cannot touch the recipe tables. Decide the coexistence question by the PC's other duties and the plant's network segmentation policy, not by database size, because the recipe row counts never get large enough to force a dedicated machine.