I have a mysql running. I can access it with
mysql -h 127.0.0.1 -u root -P 8009 -p(password requested)
Now I want to make requests with curl :
curl 127.0.0.1:8009 ???? I need to pass the password and some simple commands (INSERT in one database)
Is it possible/ how to do that ?
EDIT : Since it seems impossible, I broaden the scope of the question.
I'm open to wget or whatever to makes simple commands in a mysql base without installing specific utilities (mysql itself, python packages, etc.). So using commonly available commands in bash.
I have no real control on the environment from which I will make the requests.
32 Answers
You can't.
curl is a HTTP client. MySQL doesn't use the HTTP protocol.
There was apparently a plugin that added a HTTP API, but the MySQL Labs page says this:
These binaries were created by MySQL testing servers.
They are NOT FIT FOR PRODUCTION.
They are provided solely for testing purposes, to try the latest bug fixes and generally to keep up with the development.
- Please, DO NOT USE THESE BINARIES IN PRODUCTION.
So you're out of luck.
2Using password is only possible in the browser-basedREST API for MySQL Cloud Service.
It does not apply to your case - the protocol to communicate with MySQL is not HTTP, so you cannot use an HTTP client like cURL.
2