9 months ago
I've created an api that has endpoints for creating a user and also logging in(Lionel-Wilson/My-Fitness-Aibou-API: The API for the "My Fitness Aibou" application. (github.com))
I've deployed it and since it requires a database, I used the MYSQL database and connect it to that. I've created the relevant tables in the MYSQL template for the API to run properly. e.g. "users". However when I try to hit the sign up endpoint, I'm met with the following response from that comes from the database:
{
"statusCode": 500,
"message": "Something went wrong. Please try again later.",
"errors": [
"Error 1406 (22001): Data too long for column 'user_name' at row 1"
]
}
From research, apparently this is to do with the database being in "strict" mode(sql - Error Code: 1406. Data too long for column - MySQL - Stack Overflow). How would I go about changing the database mode for this mysql service in railway? The documentation for databases are very light and doesn't tell you much about making more specific changes to your database. Please help
2 Replies
9 months ago
Hello Lionel,
Please refer to the stack overflow page you linked on how to set the mode on a MySQL database as it should cover all you need to know.
9 months ago
Hello Lionel,
Please refer to the stack overflow page you linked on how to set the mode on a MySQL database as it should cover all you need to know.
@brody I've managed to solve that. But now I want to know how I can make a table column AUTO_INCREMENT?