glen
Is there a way to change the default database instance from Postgres to Mariadb or Mysql for ecto? I am aware of the option to use the database flag, but since I have years more experience with mysql, I’d love to make it the default.
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
Other Trending Topics
Happy Friday, all! :slight_smile:
Our October meetup is coming up next week - Wednesday, October 14th at 19h CET via Zoom! This month we...
New
We have 4 in-person tickets to Code BEAM Europe 2026 (21-22 October, PHIL Haarlem) to give away:
1 diversity ticket (sponsored by AppSi...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #ai
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming











Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
John-Goff
I do not believe that there is any kind of config file or anything that you could set to make your choice of database the default. I think that generally the generators are only used once when creating a project, so I’m not sure that adding such an option would be all that beneficial. If you are in fact creating new Phoenix projects on the regular you could always create a bash script which passes the flags you would like.
wmnnd
Take a look at the docs for
mix phx.new: mix phx.new — Phoenix v1.8.8You can simply specify the
--database mysqloption when creating a new Phoenix project.kokolegorille
You can always make some kind of shell alias if You really want to avoid typing –database mysql.
But You cannot change default value of phx.new
OvermindDL1
You could, however, fork it and make your own version to change the default and install your fork locally. ^.^
Seems like it would be a pretty minimal patchset to keep in sync. Maybe even PR it looking in a config in
$XDG_CONFIG_HOMEsomewhere for what default config options for it to set (don’t forget to log to user that it found a config file at a given location and is using it for defaults so it’s not silently surprising).kokolegorille
Yes, forking is a possibility
glen
Yes, but I think I’m too much of an Elixir virgin and not ready to fork…
I am at the stage where I am running several tutorials and wondering whether I am better off biting the bullet and using Postgres for now or figure out how to modify the scripts that call mix setup or phx.new to make it use MySQL.
It’s mainly the Postgres shell that makes me slow and unhappy. Maybe I’ll try a gui for Postgres and see if that works around the issue.
Thanks for your feedback, all.
kokolegorille
I would recommend to use postgresql if You want to follow tutorials, because there are some differences with mysql. Almost all tutorials I saw use it.
like ordering, or search case sensitivity, or extensions (citext, postgis etc).
I have often used mysql with Rails, but once I had to use windows functions. I don’t know if it is supported by mysql now, but 5 years ago it was not.
It’s always possible to switch later.
John-Goff
I would recommend using postgres, I started with MySQL and while it worked fine, there was a subset of ecto features that I wanted to use which required using postgres. Though switching from mysql to postgres was relatively painless all things considered, so if you do decide to go with one and then change your mind it should be doable. But yeah I wouldn’t bother modifying the script for phx.new, just use the --database flag or like I said earlier, wrap it in a bash script.
glen
In case it’s of interest, in the last 2 or 3 years windowed functions and other features like virtual columns have received significant upgrades on Mariadb and MySQL, with little functionality missing compared to MSSQL for example. Although Mariadb is usually ahead of the curve.