R
Railway

✋|help

How to connect FastAPI with Planetscale (mysqlclient error)

Rrbravo_9/9/2023
Hey, how are you guys doing? I have a backend on Railway who is running with FastAPI (using this template https://railway.app/template/-NvLj4).

I'm also using planetscale, which requires me to have mysqlclient as a dependency. The problem is that when the app is building I'm getting the error attached.

Does anyone know how can I fix this?
Rrbravo_9/9/2023
2cec54f7-d04f-4c70-8360-d4c48cf0e9b6
Maybe we need a PR like this https://github.com/railwayapp/nixpacks/pull/496 for FastAPI?
Bbrody1929/9/2023
you can always try to install that package yourself, add this as a nixpacks.toml to your project
[phases.setup]
aptPkgs = ['...', 'libmysqlclient-dev']
Rrbravo_9/9/2023
Hey, @Brody, thank you for the help! It looks like the error it's a bit different now:
Rrbravo_9/9/2023
Rrbravo_9/9/2023
Here's how I added what you told:
Bbrody1929/9/2023
the missing mysql_com.h is said to be included in libmysqlclient-dev
truthfully the mysql dependency with python has always been a mystery, with the solution being, use postgres or use some other pre-built mysql python package
let me see if I can find that package
https://discord.com/channels/713503345364697088/1133956338867773470/1134336721711009822

Looking for more? Join the community!

Recommended Posts
Hobby PlanI have a Discord bot which needs to be hosted, I had it hosted on railway before the recent pricing AttributeError: 'DatabaseWrapper' object has no attribute 'set_schema'I'm using django with mutlitenants using the package django-tenants==3.5.0 When i deployed the app tHosting errori am hosting my discord bot written in python using nextcord library and when i deploy it then it shDeploy angular applicationerror: ```2 minutes ago via GitHub Init main View Logs Removed Deployed 3 minutes ago vimongo on railwayI am trying to get mongo v7 up and running on railway. When using default options, I am getting follTCP Proxy timeoutI'm trying to start a Redis server with the official Docker image from Docker Hub with #TCP + LogginHow to move from Working Localhost w/ Django Websockets to Railway production?I had a functioning django websocket fantasy draft on my local host using daphne and redis. However,There's suddenly two new random columns in my database??I went in and checked my railway dashboard and to my surprise there's two new completely random dataRailway having issues with Mongoose NPM package???Locally my code works fine, I can connect to Mongo using Mongoose no issues but when on Railway it rNo VAT taxes on invoicesHello everyone I've just joined this server. On my invoices, I don't see any VAT tax prices includeIssue with mounting volumeHello, I have an instance of n8n running, I need to attach a volume to keep community node persistenPin memory usageI'm running a service that scales memory usage unpredictably and quickly, and it crashes in these caVariables redeploy infoSometimes when I don't have an active deployment and I change the variables it triggers a redeploy bStatic IPsIs there any updates for static IPs? I would love to use Railway for a Discord bot so everything is Prebuilt Mqtt Service and PortsLooking for some guidance. Currently have a couple different services in my project, including a posMySQL queries timeout or lead to blank screen on web versionFor the last 2 days or so I've been running into some problems with my personal project database. ItAdonisjs Migration - MySQL using password noTrying to deploy an app on railway with adonisjs and a MySQL database, I can get the web app runningGraalVMHi, is it possible to build a graalvm image in nixpacks? https://github.com/railwayapp/nixpacks/issuDebugging issuesIs their someway to get into filesystem so I can debug production errors a0aaa94d-45ad-410c-bcae-31Debugging issuesIs their somehow to get into file system? or the built files