Migration shout out an error
When i do the migration of DB at a fresh installation. I am getting the error message that the key is too long. How come? What can i do?
In Connection.php line 671:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users
add unique users_email_unique
(email
))
In PDOStatement.php line 129:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
In PDOStatement.php line 127:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
Hi there,
Is this regarding one of the scripts on the DevDojo site or is it plain Laravel application?
What I could suggest is using this command here to create your database:
CREATE DATABASE database_name CHARACTER SET utf8 COLLATE utf8_general_ci;
Another thing you could try is adding the following values in /etc/mysql/mariadb.conf.d/50-server.cnf
:
innodb-file-format=barracuda
innodb-file-per-table=ON
innodb-large-prefix=ON
innodb_default_row_format = 'DYNAMIC'
And then restart MySQL/MariaDB.
Let me know how it goes.
















Hi Bob! It always bugs me if people write: it doesn't work. And do not describe it precisely. And now i did on my own. Sorry about that. Yes, I was getting this error when i installed Wave on Ubuntu server running with Plesk. I did go straight forward to your second suggestion. And it worked fine. You are brain! Thank you very much!!
Hey,
No problem at all! Happy to hear that it's all working now!