I am using mysql 5.6 on my local machine for my laravel app and Heroku is on 5.5 meaning Ì am getting an error in production :
General error: 1293 Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause.
I suppose I can't upgrade the mysql version on Heroku so is there a way around this ?
Related
I get this following error when I try to run all my prisma migrations to MySQL Docker container on my raspberry pi. I don't have a column named datetime_precision, so this error isn't really helping me finding the source of it. Does anyone ever had this error before when usign prisma/mysql container on a RPI?
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": MySQL database "db_manager" at "192.168.0.196:3306"
Error: Unknown column 'datetime_precision' in 'field list'
0: sql_migration_connector::flavour::mysql::sql_schema_from_migration_history
at migration-engine\connectors\sql-migration-connector\src\flavour\mysql.rs:420
1: migration_core::api::DevDiagnostic
at migration-engine\core\src\api.rs:108
Edit: forgot to mention, when I run prisma migrations to a local container, it works perfectly. Migrations go through with no issue. On the RPI, the database gets created, but no tables are created.
Mysql Datetime Precision is not available in versions < 5.6 if you have an older version upgrader to mysql 5.6 or 5.7
My vps linux ubuntu is
Server type: MySQL
Server version: 5.7.33 ubuntu0.18.04.1 - (Ubuntu)
Apache/2.4.29 (Ubuntu)
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 -
PHP version: 7.2.24-
Trying to add a column in my database but im getting error
I tried that on windows xampp its work without any problem
ALTER TABLE users ADD COLUMN house LONGTEXT NOT NULL DEFAULT '{"owns":false,"furniture":[],"houseId":0}';
Error
SQL query:
ALTER TABLE users ADD COLUMN house LONGTEXT NOT NULL DEFAULT '{"owns":false,"furniture":[],"houseId":0}'
MySQL said: Documentation
#1101 - BLOB, TEXT, GEOMETRY or JSON column 'house' can't have a default value
I'm going to guess that your local XAMPP development server is running MySQL 8.0.13 or newer — or MariaDB 10.2.1 or newer. Prior to that version, MYSQL did not allow a DEFAULT value other than NULL for JSON columns. In MariaDB, JSON is an alias for LONGTEXT, which likewise (starting with version 10.2.1) allows DEFAULT values.
Probably your development environment allows the defaults and the production environment doesn't. You can either upgrade your production system or not use that feature.
Remove the default value:
ALTER TABLE users ADD COLUMN house LONGTEXT NOT NULL;
am trying to import Magento 2 database on 5.5.52-MariaDB. while it was import I got an error the import stop at admin_user ERROR: "MySQL Error There can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT clause"
I am wondering if 5.5.52-MariaDB isn't the right version and that's why I am getting this error.
As per Magento 2 Docs it does not say which version of MariaDB it requires. Does anybody knows or have more imformation about this? Thank's in advance.
Multiple TIMESTAMP columns with CURRENT_TIMESTAMP in the DEFAULT clause are allowed in MariaDB starting from 10.0. Neither MariaDB 5.5 nor MySQL 5.5 support them.
I recently moved a working CI application to a new server (AWS/Ubuntu). This new server is running PHP 7 instead of PHP 5.4 installed before. MySQL is newer too and changed mysql to mysqli. CodeIgniter is still 2.x (planning to upgrade to 3.x in the upcoming weeks).
Managed to solve some .htaccess and routing issues but now I'm getting a database error:
A Database Error Occurred
Error Number: 1366
Incorrect integer value: '' for column 'propertyDateEffect' at row 1
Since this was already working before first thing I did was checking server settings. I noticed sql_mode was "STRICT" so I modified my.cnf and it now looks like: IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION with TRADITIONAL instead of STRICT_TRANS_TABLES. This however, after a mysql restart, didn't fixed the error.
What else could it be?
I am trying to deploy a Play! 2.4 project, using eBeans and Evolutions.
However, when trying to deploy on a MySQL database I am getting the following error:
[error] p.a.d.e.DefaultEvolutionsApi - 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 'sequence donation_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
#6ocm6hnl7: Database 'default' is in an inconsistent state!
at play.api.db.evolutions.DatabaseEvolutions.checkEvolutionsState(EvolutionsApi.scala:269)
at play.api.db.evolutions.DatabaseEvolutions.evolve(EvolutionsApi.scala:226)
at play.api.db.evolutions.DefaultEvolutionsApi.evolve(EvolutionsApi.scala:81)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$play$api$db$evolutions$ApplicationEvolutions$$runEvolutions$1.apply$mcV$sp(ApplicationEvolutions.scala:62)
at play.api.db.evolutions.ApplicationEvolutions.withLock(ApplicationEvolutions.scala:98)
at play.api.db.evolutions.ApplicationEvolutions.play$api$db$evolutions$ApplicationEvolutions$$runEvolutions(ApplicationEvolutions.scala:49)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start$1.apply(ApplicationEvolutions.scala:42)
at play.api.db.evolutions.ApplicationEvolutions$$anonfun$start$1.apply(ApplicationEvolutions.scala:42)
at scala.collection.immutable.List.foreach(List.scala:381)
at play.api.db.evolutions.ApplicationEvolutions.start(ApplicationEvolutions.scala:42)
at play.api.db.evolutions.ApplicationEvolutions.<init>(ApplicationEvolutions.scala:149)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get$lzycompute(EvolutionsModule.scala:53)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:53)
at play.api.db.evolutions.ApplicationEvolutionsProvider.get(EvolutionsModule.scala:44)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:72)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:61)
at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:62)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.Guice.createInjector(Guice.java:96)
at com.google.inject.Guice.createInjector(Guice.java:73)
at com.google.inject.Guice.createInjector(Guice.java:62)
at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:126)
at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:93)
at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
at play.core.server.ProdServerStart$.start(ProdServerStart.scala:52)
at play.core.server.ProdServerStart$.main(ProdServerStart.scala:27)
at play.core.server.ProdServerStart.main(ProdServerStart.scala)
How can I fix this?
Do I have to specify somewhere that I am going to use a MySQL database for production so SQL syntax is created which is compatible with MySQL?
I do have H2 set to MYSQL mode: db.default.url="jdbc:h2:mem:play;MODE=MYSQL"
Using mySql as my development database and upgrading to version 5.6 (5.5 does not accept DateTime(6)) solved the problem.