On laravel 10 site I need in admin area to show some info on mysql database, which is used in mysql db replication.
When I need to get mysql status I run command under mysql console :
SHOW MASTER STATUS G
But with symfony/process library I can get and show output of linux commands, but not a command which I run under mysql console.
I searched in mysql-mariadb section of the documentation :
https://docs.platform.sh/guides/symfony/environment-variables.html?utm_source=symfony-cloud-sign-up&utm_medium=backlink&utm_campaign=Symfony-Cloud-sign-up&utm_content=docs#mysql-mariadb
But I did not find any hints how to get output of the command.
How this can b3e domn? Some other tools ?
"laravel/framework": "^10.35.0",
"symfony/process": "^6.4",
Thanks in advance!
2
Answers
You can run a CLI command to connect to MySQL and run the script you wanted:
Of course, you will need to replace:
with appropriate values.
You can run this using DB facades , handle the result and show in your view