How can I connect Google Cloud MySQL database to a React App - mysql

I have a MySQL database present on google cloud, and I was wondering how would I be able to connect it with my ReactJS Database so that I would be able to send SQL queries to the database and receive appropriate which I can then display on the screen. I've been unable to find a good way of doing this so far.
Would using express as a middle ground be better here? Or would there be a way to connect the google cloud database directly using React?
Thank you.

Adding database in the React.JS (Client side code) would mean the connection string to your DB can be accessible into the browser, hence the DB then would not have any firewall and accept huge number of connections and that's security & performance wise is not preferred,
and yes you need to put a middle like backend, try Fastify for example

Related

can we connect our python script with a database using the url of the database

can we connect our python script to interact with the database whose url is known.If yes then how we would do that?? and will we be able to interact with the datbase??
I am going to start working on automating a process whic right now is done manually in my company by accessing a datbase and using it for extracting values or data.
Now this is my first day and i don't know from where to start.All that i know is right now i am having a url to database and the database consists of a "query section" where i will feed what i want to search using different fields of the database query page and will get a list matching my search.
i have to use this list in my GUI that i have to develop. for this purpose i need to know how to access a database using its url and how to interact with it.My database is developed using JavaScript
i am a beginner.Please folks help me with this.
You should specify your database first. e.g mysql
then you can use a ORM like SQLALCHEMY to ease the process for you and in that case this is how you address the db, something like:
"mysql://{}:{}#{}:{}"
.format("YOUR_SQL_USERNAME","YOUR_SQL_PASSWORD", "YOUR_SQL_HOST", "YOUR_SQL_PORT")

Connecting visual c++ to an online database

I am working on an app in visual c++ which requires data to be accessed from a database which can be edited so that every time there is a modification to the data I do not have to resend the app as it will automatically update, it is also required that this is a desktop app.
I am currently using MySql however for this to run constantly I will be needing a server which for a single simple app wont really be worth purchasing, so I started thinking of alternative methods and thought to myself there must be some method of reading directly from a website or online database, am I correct in thinking this? If so could someone please explain how I would achieve this?
Also, I have purchased phpmyadmin in the past so if there is any way I could connect my visual c++ app to a database from this then that would be great.
EDIT: Note, this app relies almost entirely on the database as it is just 3 combo box's and one text field all of that values for which come from the database.
The following response is assuming that by online you mean on the web.
You cannot exactly 'connect' to an online database with C++ (or anything outside of that server hosting the database).
What I would do is create some PHP API's that you can POST to with libcurl via C++. You can both send and receive data this way.

Real-time update to NodeJS(MVC, Express), Mysql and Socket.io application

I'm trying to create a real time web application with NodeJS with an MVC layout using the Express framework and MySQL as my back end data store.
The problem that I've run into is that I can't find any good examples or tutorials on how to use Socket.io (or any other web socket platform to pass information in real time from the database to the web application. The specific problem is getting any new update to MySQL on a specific table to pass that information to, so that if new information is added to the database by a second client connection it will update on the first client connection as soon as the information is added.
Does anyone have any ideas on how to get socket.io(or another websocket connection protocol) and mysql to work together to achieve this? Any code example's or pointing me to some websites that have documentation on this topic would be appreciated.
Thank you!

Connecting MySQL Database with Google Chrome Extension?

Is it possible to do this?
I'm familiar with MySQL when it comes to webapps, but I'm learning how to create google chrome extension, and I'd like to somehow connect to my database from existing web app. I have created a form in the popup.html from google's example, and would like to send input values to a script to insert data into MySQL when user submits this data. How would I do that?
Right I'm in developing stage and uploading chrome extension is easily done without uploading to my server. So I'm just wondering how I can connect MySQL database if its not localhost?
Thanks!
I think what you don't want to give your chrome extension access to the database. That's a security nightmare of biblical proportions.
What you want to do is create a remote web-service that the extension can talk to, that then handles your database operations.
This can be as a PHP script that you call that returns a quick bit of JSON, or vastly more complex.

How to have Android App communicate with external MySQL db

I am really confused on how to get data in and out of an android app from the internet.
I imagined that I would store information in the mysql db on the server I already have set up. But from what I have read, I would need some type of in-between web service to make queries with data sent from the app.
Can anybody toss me some tips on how to get something like this started.
Or, if you know of a better way, let me know about it.
This question has been asked several times, for example here: How to get from a MySql server to an Android app?.
Bottom line - you don't connect directly. You have something on your server (like RESTful) that you connect with via HTTP.
Try this method out. I will be using this method for the current project i am working on.
You basically create a php script on a server and use http posts to send the data to the script, read the tutorial linked below for better explanation.
mysql/android tutorial