2021-10-19
2762
#python
Ekekenta Odionyenfe
72711
Oct 19, 2021 ⋅ 9 min read

Server-side rendering with FastAPI and MySQL

Ekekenta Odionyenfe I am a software engineer and technical writer who is proficient in server-side scripting and database setup.

Recent posts:

TypeScript logo over a pink and white background.

Drizzle vs. Prisma: Which ORM is best for your project?

Compare Prisma and Drizzle ORMs to learn their differences, strengths, and weaknesses for data access and migrations.

Temitope Oyedele
Nov 21, 2024 ⋅ 10 min read
Practical Implementation Of The Rule Of Least Power For Developers

Practical implementation of the Rule of Least Power for developers

It’s easy for devs to default to JavaScript to fix every problem. Let’s use the RoLP to find simpler alternatives with HTML and CSS.

Timonwa Akintokun
Nov 21, 2024 ⋅ 8 min read
Rust logo over black marble background.

Handling memory leaks in Rust

Learn how to manage memory leaks in Rust, avoid unsafe behavior, and use tools like weak references to ensure efficient programs.

Ukeje Goodness
Nov 20, 2024 ⋅ 4 min read
Robot pretending to be a person.

Using curl-impersonate in Node.js to avoid blocks

Bypass anti-bot measures in Node.js with curl-impersonate. Learn how it mimics browsers to overcome bot detection for web scraping.

Antonello Zanini
Nov 20, 2024 ⋅ 13 min read
View all posts

3 Replies to "Server-side rendering with FastAPI and MySQL"

  1. Hi, thanks a tone for your super detailed tutorial!

    Unfortunately, When I start the uvicorn server, I cannot connect to mysql because of an error as following

    > sqlalchemy.exc.ProgrammingError: (mysql.connector.errors.ProgrammingError) 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

    Seems like I need to give my password in order to connect to mysql successfully.
    Can you help fixing this? Thanks a lot!

    1. It’s because you should use the password of your MySQL Sserver in the command : “root:password@localhost:3306/serversiderendering”

  2. I guess the pydantic class attribute are typed annotated not assigned. id: int not id = int. I might be wrong tho, im not a fast api guy.

Leave a Reply