First of all, thanks for this fantastic framework. For very many years I have despaired at the direction the PHP community was taking and the big, fat and ever changing frameworks that have emerged. I've quietly ignored them, and enjoyed writing high performance web applications which have been running for well over 25 years with scarcely any changes. I was delighted to discover Trongate this week. It is right up my street. Thank you for your efforts!
I'm running a bog standard Ubuntu 22.04 environment here on my dev machine, and if I git clone the Trongate Framework, manually edit the config.php and database.php files, everything does what it says on the tin and the database tables are created and populated when I access index.php via the built in PHP server.
However, the desktop app (1.0.004) won't allow me to create an app. If I enter database credentials I get the seemingly infamous
error. None of the solutions I've found on this forum or elsewhere have improved matters. I can connect to the mysql database on localhost using the mysql command line client, and via a php script using PDO, both with exactly the same credentials as I'm putting into the JSON in the Trongate desktop app. So, I'm certain that my database setup and permissions are fine. I understand that my database should not already exist at app creation time, and I get the same error whether or not the database exists.
If I leave the database credentials blank, then I get a popup saying 'Not valid JSON'. When I click on OK, I get a flashing ~PLEASE WAIT~ message which keeps flashing forever. At this point, if I've run the desktop app from a console, it emits a message .
If you could give me some clues as to how I can debug the desktop application, I'm more than happy to put the effort in finding out and fixing what's going wrong.
Thanks again for all your work on this.
Desktop application unable to create a new app, or connect to database on Ubuntu 22.04
3 years ago
3 years ago
#1
3 years ago
#2
Hi Phil, so glad you are enjoying Trongate?
I know you said you have tried all the tips and tricks from here, but just to be sure have tried:
?
I know you said you have tried all the tips and tricks from here, but just to be sure have tried:
?
3 years ago
#3
Hi
Thanks. I've not exactly done that, but I have done the equivalent. My mysql user is 'trongate', and it has the same privileges as root. From the mysql cli client, and from PHP using PDO I can definitely connect to mysql with the user and password I'm passing in in the JSON, and that user is able to create databases. Also, the database stuff works perfectly using the same credentials in a git cloned and manually configured instance of the Trongate framework.
Thanks. I've not exactly done that, but I have done the equivalent. My mysql user is 'trongate', and it has the same privileges as root. From the mysql cli client, and from PHP using PDO I can definitely connect to mysql with the user and password I'm passing in in the JSON, and that user is able to create databases. Also, the database stuff works perfectly using the same credentials in a git cloned and manually configured instance of the Trongate framework.
3 years ago
#4
Could you please try using root user with the desktop app, just eliminate the privilege thing?
I have access to the desktop app code and can try trace the issue if this is the case.
I have access to the desktop app code and can try trace the issue if this is the case.
3 years ago
#5
Thanks for pointing me in the right direction. I've now got to the bottom of the problem.
The version of MySQL on Ubuntu 22.04 uses caching_sha2_password as the authentication plugin by default. Although the mysql command line client and PHP/mysqli/PDO (and thus the Trongate framework itself) can cope with this, I suspect that the mysql library used in the Trongate desktop app can't.
So, for anyone having this problem, the fix is that you must use the mysql_native_password plugin for the authentication of the mysql user you are going to use with your Trongate application.
The root account that is created when you install mysql-server on ubuntu 22.04 uses the auth_socket plugin which relies on the linux user and the mysql user matching (so you can only login to mysql if you are running as linux root). So, before you can use the Trongate desktop app with the mysql root account, you'll need to execute the SQL
or
if you're not fussed about having a root password.
While I've only tested this on Ubuntu 22.04, there's a strong chance that some or all of the above will also apply on any up to date Debian based system with mysql 8.
Now to do some coding! :)
The version of MySQL on Ubuntu 22.04 uses caching_sha2_password as the authentication plugin by default. Although the mysql command line client and PHP/mysqli/PDO (and thus the Trongate framework itself) can cope with this, I suspect that the mysql library used in the Trongate desktop app can't.
So, for anyone having this problem, the fix is that you must use the mysql_native_password plugin for the authentication of the mysql user you are going to use with your Trongate application.
The root account that is created when you install mysql-server on ubuntu 22.04 uses the auth_socket plugin which relies on the linux user and the mysql user matching (so you can only login to mysql if you are running as linux root). So, before you can use the Trongate desktop app with the mysql root account, you'll need to execute the SQL
or
if you're not fussed about having a root password.
While I've only tested this on Ubuntu 22.04, there's a strong chance that some or all of the above will also apply on any up to date Debian based system with mysql 8.
Now to do some coding! :)
3 years ago
#6
Glad I managed to prompt you in the right direction. This issue with MySQL is also a thing on a Mac, however, I haven't experienced it on Windows. Personally, I would rather use MariaDB over MySQL ??
Happy coding Phil, and please close off this thread when you get a moment.
Happy coding Phil, and please close off this thread when you get a moment.
3 years ago
#7
I tried the "fix" by removing the password but seem to be getting the same issue, I use MAMP PRO which has multiple instances running. I have created a webspace called trongate.local which has its own internal SSL certificate so is found at https://trongate.local. I dont really want to use XAMP is there a workaround? or am I stuffed?
Thanks in advance
Keith
Thanks in advance
Keith