FaserF/hassio-addons

PHP cannot reach database

Closed this issue · 3 comments

The problem

is it possible to work with bootstrap in this apache? I have a php website that works fine but the bootstrap tables don't. or could this not be the case? I have tried it on another web server, it works here.

What version of Home Assistant Core has the issue?

Home Assistant 2023.1.0 Supervisor 2022.12.1 Operating System 9.4 Frontend-versie: 20230104.0 - latest

What version of the addon has the issue?

apache 2.4.1

What type of installation are you running?

Home Assistant OS

Add-On causing the issue

Apache2

Log information

[Thu Jan 05 12:43:51.546840 2023] [php:error] [pid 157] [client 192.168.0.2:44803] PHP Fatal error:  Uncaught mysqli_sql_exception: The user specified as a definer ('root'@'%') does not exist in /share/htdocs/noodnrs/nntl.php:1211\nStack trace:\n#0 /share/htdocs/noodnrs/nntl.php(1211): mysqli_query()\n#1 {main}\n  thrown in /share/htdocs/noodnrs/nntl.php on line 1211, referer: http://192.168.0.36/noodnrs/nntl.php
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "POST /noodnrs/nntl.php HTTP/1.1" 200 36450
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/es6-promise/es6-promise.auto.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/html2canvas/html2canvas.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/jsPDF/jspdf.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/js-xlsx/xlsx.core.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/tableExport.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/FileSaver/FileSaver.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/es6-promise/es6-promise.auto.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/html2canvas/html2canvas.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/jsPDF/jspdf.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/js-xlsx/xlsx.core.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/libs/FileSaver/FileSaver.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:12:43:51 +0100] "GET /noodnrs/tableExport.min.js HTTP/1.1" 404 272
127.0.0.1 - - [05/Jan/2023:12:43:57 +0100] "OPTIONS * HTTP/1.0" 200 -
[Thu Jan 05 13:14:20.864450 2023] [php:error] [pid 160] [client 192.168.0.2:46611] PHP Fatal error:  Uncaught mysqli_sql_exception: The user specified as a definer ('root'@'%') does not exist in /share/htdocs/noodnrs/nntl.php:1211\nStack trace:\n#0 /share/htdocs/noodnrs/nntl.php(1211): mysqli_query()\n#1 {main}\n  thrown in /share/htdocs/noodnrs/nntl.php on line 1211, referer: http://192.168.0.36/noodnrs/nntl.php
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "POST /noodnrs/nntl.php HTTP/1.1" 200 36450
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/es6-promise/es6-promise.auto.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/html2canvas/html2canvas.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/js-xlsx/xlsx.core.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/tableExport.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/FileSaver/FileSaver.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/jsPDF/jspdf.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/es6-promise/es6-promise.auto.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/html2canvas/html2canvas.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/jsPDF/jspdf.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/jsPDF-AutoTable/jspdf.plugin.autotable.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/js-xlsx/xlsx.core.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/libs/FileSaver/FileSaver.min.js HTTP/1.1" 404 272
192.168.0.2 - - [05/Jan/2023:13:14:20 +0100] "GET /noodnrs/tableExport.min.js HTTP/1.1" 404 272
127.0.0.1 - - [05/Jan/2023:13:14:26 +0100] "OPTIONS * HTTP/1.0" 200 -

Additional information

No response

You will most likely need to install the MariaDB Homeassistant Addon and create the necessary user and database over there.
This Addon only ships with the database connection possibilities but not with a database itself

sorry i found the problem, the first one was indeed a user error in the dbase but then it turned out that my php runs on 7 and the new one on 8. and that causes some problems. but thanks for your response.

gr. Marco