1

I am wondering if anyone can show me how to connect my react app create with create-react-app to connect to a local mysql database. Is there any library out there that does this or do I have to start completely from scratch?

2 Answers 2

0

You're going to have to build a server with API routes to query the data from your database.

Sign up to request clarification or add additional context in comments.

4 Comments

But create-react-app comes with a server. Do I need to create a separate server for this task?
create-react-app comes with a webpack development server.
Yes. So I can just use that server?
Nah I don't believe you can actually edit that server, you would have to build out your own with API routes.
0

You need some sort of backend server script build with language such as php or nodejs that will create api endpoints to be consumed by your react scripts

1 Comment

But create-react-app comes with a server. Do I need to create a separate server for this task?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.