![]() Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.Īt new GhostError /var/lib/ghost/versions/3.20.2/core/index.js:16:23Įrror: UNKNOWN_CODE_PLEASE_REPORT: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. InternalServerError: create table `migrations_lock` (`lock_key` varchar(191) not null, `locked` boolean default '0', `acquired_at` datetime null, `released_at` datetime null) default character set utf8mb4 - UNKNOWN_CODE_PLEASE_REPORT: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.Ĭreate table `migrations_lock` (`lock_key` varchar(191) not null, `locked` boolean default '0', `acquired_at` datetime null, `released_at` datetime null) default character set utf8mb4 - UNKNOWN_CODE_PLEASE_REPORT: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. ERROR create table `migrations_lock` (`lock_key` varchar(191) not null, `locked` boolean default '0', `acquired_at` datetime null, `released_at` datetime null) default character set utf8mb4 - UNKNOWN_CODE_PLEASE_REPORT: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. I am using mysql database from digitalocean and I getting an error which preventing the container from starting. With a bit of time and effort, I’ve now converted all my MySQL databases to MariaDBĪs part of my goal of ridding myself of all Oracle software.I am using the image ghost:3.35.5-alpine with the database client mysql. Sudo docker exec -i container_name mysqldump -u username -p database > database_db.sqlĬhange the docker-compose.yml file to use MariaDB.Ģ 3 # inputs 4 5 echo "Enter application name (lower case):" 6 read APPNAMEħ 8 read -p "Enter the directory with the docker-compose.yml file: " -e -i ` pwd `/ $APPNAME DOCKERDIRĩ read -p "Enter the container name: " -e -i $_db.sqlġ9 20 echo "Changing directories to $DOCKERDIR " 21 cd $DOCKERDIR 22 23 echo "Dumping MySQL database to $FILENAME " 24 sudo docker exec -i $CONTAINERNAME mysqldump -u $USERNAME -p $PASSWORD $DATABASE > $FILENAME 25 26 echo "Stopping containers" 27 sudo docker-compose downĢ8 29 # - 30 # Wait for user to modify compose file 31 32 read -p "Press enter once you have modified the docker-compose.yml file" 33 34 # - 35 # Data import 36 37 echo "Changing directories to $DOCKERDIR " 38 cd $DOCKERDIR 39 40 echo "Deleting old volume $VOLUMENAME " 41 sudo docker volume rm $VOLUMENAME 42 43 echo "Starting containers" 44 sudo docker-compose up -dĤ5 46 echo "Waiting 90 seconds" 47 sleep 90 48 49 echo "Loading MySQL database from $FILENAME " 50 echo "sudo docker exec -i $CONTAINERNAME mysql -u $USERNAME -p $PASSWORD $DATABASE < $FILENAME " 51 sudo docker exec -i $CONTAINERNAME mysql -u $USERNAME -p $PASSWORD $DATABASE < $FILENAME 52 53 #echo "Removing $DOCKERDIR/$FILENAME" 54 #rm $DOCKERDIR/$FILENAME Conclusion While it sounds simple enough,ĭump the MySQL database of the current database container. Start a new MariaDB database, and reimport the data. This meant that I would need to export the data from each database, delete the volume, This presented the problem that I simply couldn’t stop the old MySQL container,Īnd start a new MariaDB container with the existing volume of the /var/lib/mysqlįolder (which contains MySQL’s data) as is supported The challenge was that I had previously used MySQL 8 for my databases. This ended up being more complicated than I initially hoped. I decided I wanted to swap out my MySQL databases. I had heard of MariaDB in the past, and knew it was aĭrop-in replacement to MySQL, but I didn’t really know much about it.Īfter recently reading about some of MariaDB’s Recently, when I setup a number of Docker Compose stacks for myself, I naively
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |