MySQL Configuration
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
MySQL Configuration
I intend to install Meteotemplate on my own server (LAN only), without Internet access. This server is hosted on a Raspberry Pi 3 (Raspbian Buster), which runs LAMP. (Uses Apache).
For the structure of folders and files, I followed the instructions of the Wiki.
I assume that this structure is the right one for an Apache server, because I get to show the script setup.php in Chrome and Chromiun browsers, from either of these two addresses
http://192.168.1.123/template/install/setup.php
http://meteomungi/template/install/setup.php
I run "Server Check" and it tells me everything is correct. But, when I run "Check MySQL", it returns this error message:
"Debugging error number: 2002
Debugging error: php_network_getadress: getadd info failed: Name or service not know."
Some data from the MariaDB/MySQL configuration for the root user.
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
+--------------------+
+----------------------+
| @@datadir |
+----------------- ----+
| /var/lib/mysql |
+--------------- ------+
Current user. root@localhost
Protocol version: 10
Connection: Localhost via UNIX socket
UNIX socket: /var/run/mysqld/mysqld.sock
I run phpMyAdmin with Username: phpmyadmin (this is the real user name I use) and Password: [mypassword].
From the SQL tab, I made two queries, with these results;
- hostname = meteomungi (matches my RPi host name)
- port = 3306
I don't know how to make other useful queries.
In the MySQL parameters I've done a lot of tests.
For Host address, I have tested
http://meteomungi
http://192.168.1.123 (my static IP)
http://localhost
http://127.0.0.1
The previous four, followed by 3306 (e.g. http://meteomungi:3306)
The previous four, followed by /template (e.g., http://meteomungi/template)
and a few more combinations, which I don't remember.
For User, I have tried: "root", "pi" and "phpmyadmin"
Pasword, I've always used the same password (all RPi server passwords are the same).
I have consulted dozens of websites and also in the forum, especially this threads:
http://meteotemplate.com/forum/viewtopic.php?f=49&t=456
viewtopic.php?t=1383
The "audum" user's website is working properly and, I think, it runs on a Raspberry Pi server, with Internet access.
I have reviewed several configuration files, both MariaDB and MySQL, but my knowledge of Linux is very limited and those of web servers, almost null. As a consequence, I still can't find the solution.
For the structure of folders and files, I followed the instructions of the Wiki.
I assume that this structure is the right one for an Apache server, because I get to show the script setup.php in Chrome and Chromiun browsers, from either of these two addresses
http://192.168.1.123/template/install/setup.php
http://meteomungi/template/install/setup.php
I run "Server Check" and it tells me everything is correct. But, when I run "Check MySQL", it returns this error message:
"Debugging error number: 2002
Debugging error: php_network_getadress: getadd info failed: Name or service not know."
Some data from the MariaDB/MySQL configuration for the root user.
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
+--------------------+
+----------------------+
| @@datadir |
+----------------- ----+
| /var/lib/mysql |
+--------------- ------+
Current user. root@localhost
Protocol version: 10
Connection: Localhost via UNIX socket
UNIX socket: /var/run/mysqld/mysqld.sock
I run phpMyAdmin with Username: phpmyadmin (this is the real user name I use) and Password: [mypassword].
From the SQL tab, I made two queries, with these results;
- hostname = meteomungi (matches my RPi host name)
- port = 3306
I don't know how to make other useful queries.
In the MySQL parameters I've done a lot of tests.
For Host address, I have tested
http://meteomungi
http://192.168.1.123 (my static IP)
http://localhost
http://127.0.0.1
The previous four, followed by 3306 (e.g. http://meteomungi:3306)
The previous four, followed by /template (e.g., http://meteomungi/template)
and a few more combinations, which I don't remember.
For User, I have tried: "root", "pi" and "phpmyadmin"
Pasword, I've always used the same password (all RPi server passwords are the same).
I have consulted dozens of websites and also in the forum, especially this threads:
http://meteotemplate.com/forum/viewtopic.php?f=49&t=456
viewtopic.php?t=1383
The "audum" user's website is working properly and, I think, it runs on a Raspberry Pi server, with Internet access.
I have reviewed several configuration files, both MariaDB and MySQL, but my knowledge of Linux is very limited and those of web servers, almost null. As a consequence, I still can't find the solution.
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
if it's worth anything this is what I have in me config file on my PI 4
Code: Select all
$dbName = 'lobwx';
$con = mysqli_connect('localhost','my-user',my-'password',$dbName);
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
Thank you very much for your interest in helping me solve my problem.
Unfortunately, my knowledge of Linux and web servers is very limited. I assume I have to run the sudo mysql command to get this terminal window. Is it right or should I do everything from the root of the Raspbian terminal?
In either case, my doubts are as follows:
1.- I don't want to create a database. According to the Wiki, once the connection is checked, a database is created automatically. Is it necessary to create a database?
2.- I have created a "root" user of MariaDB with his "password". Is it necessary to create another user with a different password?
3.- The command to write must be:
con = mysqli_connect('localhost','root','yomismo');
or
con = mysqli_connect('localhost','root',my-'yomismo');
In any case, thank you very much for your help.
Unfortunately, my knowledge of Linux and web servers is very limited. I assume I have to run the sudo mysql command to get this terminal window. Is it right or should I do everything from the root of the Raspbian terminal?
In either case, my doubts are as follows:
1.- I don't want to create a database. According to the Wiki, once the connection is checked, a database is created automatically. Is it necessary to create a database?
2.- I have created a "root" user of MariaDB with his "password". Is it necessary to create another user with a different password?
3.- The command to write must be:
con = mysqli_connect('localhost','root','yomismo');
or
con = mysqli_connect('localhost','root',my-'yomismo');
In any case, thank you very much for your help.
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
1. you can always come back and delete it.El_Viejo wrote: ↑Tue Oct 01, 2019 9:14 am 1.- I don't want to create a database. According to the Wiki, once the connection is checked, a database is created automatically. Is it necessary to create a database?
2.- I have created a "root" user of MariaDB with his "password". Is it necessary to create another user with a different password?
3.- The command to write must be:
con = mysqli_connect('localhost','root','yomismo');
or
con = mysqli_connect('localhost','root',my-'yomismo');
In any case, thank you very much for your help.
2. I suggest that you should. To create a database user, type the following command. Replace username with the user you want to create, and replace password with the user's password:
Code: Select all
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
3. $dbName = 'lobwx';
$con = mysqli_connect('localhost','user','password',$dbName);
Hope it helps. You should probably use PhpMyAdmin to administer mysql/databases, makes it a lot easier. https://www.phpmyadmin.net/
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
Thank you very much for your help. I will follow your recommendations.
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
I have advanced, but I have problems with mysqli_connect.
Successfully, I created a new user (javier), with password (viva) and a database (deriodb).
I have done several tests with the connection command:
In all cases the syntax error 1064 appears.
My PHP version is 7.3.9-1-deb10u1.
Can you help me discover the error? I'm a total novice and I have no choice but to abuse your patience. Thank you very much.
Successfully, I created a new user (javier), with password (viva) and a database (deriodb).
I have done several tests with the connection command:
Code: Select all
con = mysqli_connect('localhost','javier','viva','deriodb');
con = mysqli_connect('localhost', 'javier', 'viva', 'deriodb');
con = mysqli_connect(localhost,javier,viva,deriodb);
My PHP version is 7.3.9-1-deb10u1.
Can you help me discover the error? I'm a total novice and I have no choice but to abuse your patience. Thank you very much.
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
Here is a screenshot.
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
All this goes into the /template/config.php file
Code: Select all
$dbName = 'deriodb';
$con = mysqli_connect('localhost','javier','viva',$dbName);
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
Sorry, but I can't find the file "config.php" in the folder "template".
Is it necessary to create it?
Thanks again.
Is it necessary to create it?
Thanks again.
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
I have read WiKi again and check that the config.php file is created after running for the first time the setup.php file located in /template/install.
Then, I assume that I must do the following operations:
1.- Run the setup.php file and save it.
2.- Edit the config.php file that will have been created and include these two lines
Is that correct?
Excuse my clumsiness. Thank you
Then, I assume that I must do the following operations:
1.- Run the setup.php file and save it.
2.- Edit the config.php file that will have been created and include these two lines
Code: Select all
$dbName = 'deriodb';
$con = mysqli_connect('localhost','javier','viva',$dbName);
Excuse my clumsiness. Thank you
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
I was under the assumption you had already ran the setup.php. It's been at least two years since I installed my site. I kind of half remember.
Run the setup.php. Then report your progress/findings.
If I remember it pretty much does nearly everything, creates the database and more.
Run the setup.php. Then report your progress/findings.
If I remember it pretty much does nearly everything, creates the database and more.
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
I apologize for my limitations with the English language.
In my RPi, with the Chromiun browser, from the static IP (192.168.1.50) , I write http://192.168.1.50/template/install/setup.php
and the Meteotemplate installation page opens.
I run "Server Check" and it tells me everything is correct. But, when I run "Check MySQL", it returns this error message:
"Debugging error number: 2002
Debugging error: php_network_getadress: getaddrinfo failed: Name or service not know."
Host address = http://localhost
User = javier or root
Password = viva or yomismo
database name = deriodb or empty
Thank you for your help
In my RPi, with the Chromiun browser, from the static IP (192.168.1.50) , I write http://192.168.1.50/template/install/setup.php
and the Meteotemplate installation page opens.
I run "Server Check" and it tells me everything is correct. But, when I run "Check MySQL", it returns this error message:
"Debugging error number: 2002
Debugging error: php_network_getadress: getaddrinfo failed: Name or service not know."
Host address = http://localhost
User = javier or root
Password = viva or yomismo
database name = deriodb or empty
Thank you for your help
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
Enter these commands and lets see what you get. This is what the info from my Mariadb shows.
Then we should be able to narrow down what to put in your /template/config.php
BTW do you have phpMyAdmin installed?
Then we should be able to narrow down what to put in your /template/config.php
BTW do you have phpMyAdmin installed?
Code: Select all
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 938
Server version: 10.3.17-MariaDB-0+deb10u1 Raspbian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| lobwx |
| mysql |
| next |
| performance_schema |
| phpmyadmin |
| pws |
+--------------------+
7 rows in set (0.001 sec)
MariaDB [(none)]> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [mysql]> SELECT user FROM user;
+--------------+
| user |
+--------------+
| oc_bettsr671 |
| pi |
| oc_bettsr671 |
| phpmyadmin |
| root |
+--------------+
5 rows in set (0.001 sec)
MariaDB [mysql]>
Last edited by LOBWX on Mon Oct 07, 2019 6:08 pm, edited 1 time in total.
Just BE NICE! That's all it takes to be a decent human...
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
YES' on or about lines 13 or 14El_Viejo wrote: ↑Sun Oct 06, 2019 8:56 pm I have read WiKi again and check that the config.php file is created after running for the first time the setup.php file located in /template/install.
Then, I assume that I must do the following operations:
1.- Run the setup.php file and save it.
2.- Edit the config.php file that will have been created and include these two linesIs that correct?Code: Select all
$dbName = 'deriodb'; $con = mysqli_connect('localhost','javier','viva',$dbName);
Excuse my clumsiness. Thank you
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
Affirmative, I have phpMyAdmin installed.
I include it as an attachment are the results with sudo mysql and the three commands.
Thanks again
I include it as an attachment are the results with sudo mysql and the three commands.
Thanks again
- Attachments
-
- Forum_MySQL_01.PNG (54.11 KiB) Viewed 8837 times
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
ok now edit your /template/config.php
Then run the "Check MySQL" again with any luck you should have no errors.
$dbName = 'deriodb';
$con = mysqli_connect('localhost','javier','viva',$dbName);
Then run the "Check MySQL" again with any luck you should have no errors.
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
Thank you for your patience and help. I'll try it tomorrow.
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
I have opened the page "setup.php", entered the data and saved it.
The file "config.php" has been created.
In this file, I only changed one data in "mysqli_connect", because the rest are correct. I changed 'http://localhost' to 'localhost' and saved it.
Then I tried to access again to the page setup.php and this message appears: "Unauthorized access. Please log in as an administrator first."
In the Wiki it says "Once the password is set on this page you will only be able to access this page after you login on the main site."
But, what is the main site?
Thanks
The file "config.php" has been created.
In this file, I only changed one data in "mysqli_connect", because the rest are correct. I changed 'http://localhost' to 'localhost' and saved it.
Then I tried to access again to the page setup.php and this message appears: "Unauthorized access. Please log in as an administrator first."
In the Wiki it says "Once the password is set on this page you will only be able to access this page after you login on the main site."
But, what is the main site?
Thanks
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
http://yourdomain.com/template
example: http://lobwx.com/template
The admin login button is on the bottom of the page on the right.
example: http://lobwx.com/template
The admin login button is on the bottom of the page on the right.
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
Your patience is almost infinite. Thank you very much.
But write what you write,
http://192.168.1.50 or http://192.168.1.50/template
this is the page that appears. I think the error is in the paths
But write what you write,
http://192.168.1.50 or http://192.168.1.50/template
this is the page that appears. I think the error is in the paths
- Attachments
-
- Config_01.PNG (21.01 KiB) Viewed 8806 times
-
- Inicio_01.PNG (44.94 KiB) Viewed 8806 times
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
Getting closer.
You also need to fix this, just localhost NO http://localhost
Do you not have a FQDN "domain name" .com , .net, or something?
Code: Select all
$path = '/template/';
$pageURL = 'http://lobwx.com';
$baseURL = dirname(__FILE__)."/";
$adminPassword = 'mypass';
$updatePassword = 'mypass';
Code: Select all
$con = mysqli_connect('localhost','user','password',$dbName);
Do you not have a FQDN "domain name" .com , .net, or something?
Just BE NICE! That's all it takes to be a decent human...
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
I am using my RPi as a LAMP server, in a local area network, without Internet access.
I will try to modify the config.php file to $path = '/template/'; instead of $path = 'http://192.168.1.50/template/index.php'. It will probably work.
Tomorrow I'll tell you the result.
Thank you.
I will try to modify the config.php file to $path = '/template/'; instead of $path = 'http://192.168.1.50/template/index.php'. It will probably work.
Tomorrow I'll tell you the result.
Thank you.
-
- Advisor
- Posts: 80
- Joined: Wed Sep 11, 2019 3:56 pm
- Location: Derio - Bizkaia - Spain
- Station model: Netatmo
Re: MySQL Configuration
I needed to repeat the whole process in another RPi.
I managed to start the Control Panel and register my Meteotemplate. Here is the proof
But "Table Create" displays this message: "Table was not created, please check your MySQL setup."
I'll keep investigating, but I'm sure I'll need your help. Do you still have patience?
In any case, thank you very much.
I managed to start the Control Panel and register my Meteotemplate. Here is the proof
But "Table Create" displays this message: "Table was not created, please check your MySQL setup."
I'll keep investigating, but I'm sure I'll need your help. Do you still have patience?
In any case, thank you very much.
- Attachments
-
- Panel_Control_01.PNG (103.61 KiB) Viewed 8783 times
- LOBWX
- Forecaster
- Posts: 104
- Joined: Sun Mar 11, 2018 6:43 pm
- Location: Los Osos, CA
- Station model: Ambient WS 1401-IP
- Software: MeteoBridge
- Contact:
Re: MySQL Configuration
You may want to check phpMyAdmin for the correct privileges on the the database you are using
Just BE NICE! That's all it takes to be a decent human...