I am trying to do a migration with Django to a MySQL database, but I am receiving this error:
(1005, "Can't create table '#sql-60_f71' (errno: 13)")
I have done several migrations before to this database and this is the first time I am seeing this error. The thing that really confuses me is that my migration isn't even creating a table. Here is what the migrations look like:
operations = [
migrations.AddField(
model_name='inverter',
name='custom_name',
field=models.CharField(blank=True, default=b'', max_length=30),
),
migrations.AlterField(
model_name='status',
name='generic_name',
field=models.CharField(default=b'Status', max_length=20),
),
]
Found the answer here https://stackoverflow.com/a/4037158/5285571. I was having trouble because my database was not located at /var/lib/mysql
. I ended up having to do sudo chown -R mysql:mysql /usr/local/mysql/data/my_database
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With