ncjay
Junior Member
Posts: 71
|
Post by ncjay on May 19, 2021 14:18:50 GMT -8
I have a feeling this is a really embarrassing newbie question, but I'm not a complete newbie. Here goes anyway.
When I began to configure my existing SkyWeather2 for the new solar AQ and Lightning sensors, I ran into a problem with mosquitto (among other things, I didn't know the password to make any configuration changes. I can elaborate but that info isn't relevant to this query). Fair enough; I ordered an SDL SD card, which just came today.
I got the pi back on the network with the SD card, did a git pull to update, and copied over my SkyWeather2.JSON file from the previous image. All testing went well.
When I went to officially start SkyWeather2.py, this happened:
pi@SwitchDocLabs:~/SDL_Pi_SkyWeather2 $ sudo python3 SkyWeather2.py ./SkyWeather2.JSON File exists -------- MySQL Database WeatherSenseWireless Updates Not Installed. Run this command: sudo mysql -u root -p WeatherSenseWireless < updateWeatherSenseWireless.sql SkyWeather2 Stopped -------- SkyWeather2 Requirements Error Exit
OK, I can do that. But:
pi@SwitchDocLabs:~/SDL_Pi_SkyWeather2 $ sudo mysql -u root -p WeatherSenseWireless < updateWeatherSenseWireless.sql Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
What am I doing wrong here? I didn't run into this issue when I did my original install on a fresh Buster image.
Thanks ncjay
|
|
|
Post by doxidad on May 19, 2021 16:35:42 GMT -8
That error means you haven't been authenticated by the database - probably a password problem
Make sure you can log into the database with the command and then enter your password (don't know what SDL's default is).
pi@WPI2:~/SDL_Pi_SkyWeather2 $ sudo mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9837 Server version: 10.3.27-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)] If you can do this check to make sure the WeatherSenseWireless exists with this command MariaDB [(none)]> show databases; +----------------------+ | Database | +----------------------+ | SkyWeather2 | | WeatherSenseWireless | | information_schema | | mysql | | performance_schema | | phpmyadmin | +----------------------+ 6 rows in set (0.001 sec)
MariaDB [(none)]>
If you can log in OK and the database exists - I'm not sure what the problem could be.
|
|
ncjay
Junior Member
Posts: 71
|
Post by ncjay on May 19, 2021 18:07:19 GMT -8
Thanks, but no luck. The mysql root password is distinct from root's login password on the pi (at least as I understand things).
|
|
|
Post by doxidad on May 20, 2021 3:46:11 GMT -8
If database access worked OK before, you should be able to find the mysql root password in the SkyWeather2.JSON file.
|
|
ncjay
Junior Member
Posts: 71
|
Post by ncjay on May 20, 2021 6:24:29 GMT -8
Indeed, there it was, and it worked. It never occurred to me to look there. The default password is a rather weak one.
I did have to drop all the tables that updateWeatherSenseWireless.sql attempts to create first; after that, the update completed without further errors.
Thanks for your help.
|
|
|
Post by doxidad on May 20, 2021 10:31:08 GMT -8
If you wish to change the root password in the database log into mysql as root -> sudo mysql -u root -p mysql
Use this command
MariaDB [mysql]> set password for 'root'@'localhost'=PASSWORD('new-password');
Make sure you change the password in SkyWeather2.JSON with SkyWeatherConfigure.py
|
|