sashaafm
Keep getting a 1064 (MySQL) error when trying to run mix test
** (Mariaex.Error) (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
(ecto) lib/ecto/adapters/sql.ex:185: Ecto.Adapters.SQL.query!/5
(ecto) lib/ecto/adapters/mysql.ex:85: anonymous fn/4 in Ecto.Adapters.MySQL.execute_ddl/3
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
(ecto) lib/ecto/adapters/mysql.ex:85: Ecto.Adapters.MySQL.execute_ddl/3
(ecto) lib/ecto/migration/runner.ex:89: anonymous fn/2 in Ecto.Migration.Runner.flush/0
(elixir) lib/enum.ex:1473: Enum."-reduce/3-lists^foldl/2-0-"/3
(ecto) lib/ecto/migration/runner.ex:87: Ecto.Migration.Runner.flush/0
(stdlib) timer.erl:181: :timer.tc/
I’m getting this error when running mix test. It’s a Phoenix application.
I’ve tried a lot of things. Deleting all tests, old branches, commenting certain sections, deleting the git repo and downloading again, upgrading mysql, removing mysql and installing again, upgrading some deps.
In my colleague’s laptop this runs fine and we’ve got the exact same setup (Ubuntu, same MYSQL version, same erlang and elixir version). This was working fine some time ago, but now it breaks with this error.
We’re at a loss on how to solve this
It seems to come from a bad query in Ecto that’s using something from timer.erl (maybe something related to processes sleeping?
Marked As Solved
sashaafm
Dropping the test DB and creating again seems to have solved it. I guess removing MySQL doesn’t remove its databases along with it?
Also Liked
AstonJ
That’s usually correct. Also worth noting that if you upgrade you sometimes need to run an upgrade to update your DBs too (so always check release notes).
sashaafm
AstonJ
You could have tried to repair/rebuild tables: https://dev.mysql.com/doc/refman/5.7/en/rebuilding-tables.html something I’ve had to do often when using MySQL.
…and something I’ve never had to do with Postrges
![]()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









