Error with the version of the database in liferay 7 - mysql

I work with Eclipse and I want to use the version 7 of Liferay but when I run my Tomcat server I have an error with MySQL.
Please upgrade to at least MySQL 5.6.4. The portal no longer supports older versions of MySQL
Like this the problem is pretty obvious but my SQL version is already 5.7.19
I have check my driver of MySQL in preference->data management->connectivity->driver definition and my MySQL JDBC Driver is 5.1
I want to know if someone already had this issue and know how to fix it

This is how the version gets validated, and this is how the version string gets constructed. I'd say: Please make extra extra extra sure that you are addressing the mysql server that you intend to address:
You can check your mysql version from the mysql command line client by executing select version();. Get your credentials and database URL from Liferay's portal-ext.properties or your appserver's connection pool configuration, depending on where you configured it.

Related

Maxscale not allowed to connect mysql8 with java application

I have a mysql 8.0.3 database over top of that maxscale server is running when i tried to connect with that mysql jdbc driver this error is coming unknown system variable 'query_cache_size'. But when i tried to connect directly to database is working for me. query_cache_size parameters removed from mysql 8.
The query cache has been deprecated. BTW 8.0.3 is a very old version (4 years) and was pre-general availability (a release candidate) so please do not use it for production.
Edit: With MXS-2890 fixed, you should now be able to configure version_string=8.0.16-mysql in MaxScale to solve this problem
This is most likely caused by the following bug: https://jira.mariadb.org/browse/MXS-2890
The MariaDB JDBC connector should not suffer from this problem which means installing it instead of the MySQL JDBC connector can be used as a workaround.
In your /etc/maxscale.cnf you can add version_string=5.6
[Read-Write-Service]
type=service
router=readwritesplit
servers=master
version_string=5.6
user=user
password=********```
after that i am able to access mysql8 on top of maxscale server.

MySQL 8.0.11 error connecting due to caching_sha2_password

When I try to connect to server on MySQL Workbench, I get the error saying
Your connection attempt failed to user 'root' from your host to server as localhost:3306:
Authentication plugin caching_sha2_password cannot be loaded:
The specified module could not be found.
It seems like I do not have the module for caching_sha2_password installed. How do I install this plugin?
I tried to follow steps provided here. But this is my first interaction with MySQL, so I did not understand the steps.
For example, under Using SHA-2 Pluggable Authentication, it says
"storing those values in the plugin and authentication_string columns of the > mysql.user system table."
But where is the mysql.user system table and how do I access it and store the values?
Any help would be greatly appreciated!
You are looking at the wrong places. The story is this:
MySQL 8 introduced a new authentication method: caching_sha2_password which improves performance (hence the caching) for a secure authentication (the sha2 hashing). This breaking change had been made the default for new accounts pretty late so that MySQL Workbench (and quite a number of other client tools) could not be made ready for it when MySQL 8.0.11 was released. Unprepared client applications/libraries will show the mentioned error.
Many of the socalled "solutions" simply recommend to switch the authentication method to the older, less secure one (MySQL native). This is rather a hack than a solution. And keep in mind this only applies to new accounts which by default use the new auth method. Existing accounts (e.g. when you upgrade an older server to 8.0) still work as before, unless you explicitly changed the user's auth method.
Meanwhile MySQL Workbench catched up here and there's a release candidate (MySQL Workbench 8.0.11 RC) available on the MySQL download page (see the "Development Releases" tab). Use that for your 8.x server. A GA version will follow soon.

MySQL Workbench: 'Use the old authentication protocol.' option causes error

When I try to connect to an old MySQL database using MySQL Workbench using the Use the old authentication protocol option under the Advanced tab, MySQL Workbench returns this error:
You have an error in your SQL syntax near 'SESSION VARIABLES LIKE 'lower_case_tables_name' at line 1
Workbench v6.1.7
MySQL server v3.23.41 on RedHat
Database and Tables
are lowercase and uppercase (camelCase).
How can I fix this error?
I had to look this up, as I do not have any 3.x any more:
The GLOBAL and SESSION modifiers are new in MySQL 4.0.3.
I also got this:
Oracle MySQL Workbench does not support MySQL Server versions 4.x.
Your best option is stick to the mysql command line client (or update MySQL Server, as 3.23.41 was released on 11 August 2001).

Mysql Entityframework throws exception "Facet 'Precision' must not be specified for type 'datetime'"

I am using MYSQL and EF5(DB first) with connector/net 6.8.3.0. Everything works fine on my local machine but when I upload it to server it throws exception "Facet 'Precision' must not be specified for type 'datetime'".
Please let me know what is the reason.
Precision for datetime is added with MYSQL version 5.6 and I have generated the entities with latest MYSQL, so by default precision is added to the ssdl.
But on my server older version of MYSQL server was installed. This is the reason why it was throwing the exception.
Now with MYSQL server 5.6 we can have datetime(5) where 5 is the precision.
So we can have microsecond for datetime in MYSQL.
I too have been getting the "Facet 'Precision' must not be specified for type 'datetime'" error after publishing, but the cause of my problem differs from the OP's.
My Personal Solution
I have two independent servers: 'server1' with the EF5 web app, 'server2' with the database server1 references. Debugging the app on my local machine was no problem; but after I published to server1 the app kept crashing while trying to load. After much searching and testing I narrowed it down to either a configuration issue either with my application or MySQL. Finding this post (thank you kindly, user3275493, for answering your own question), I checked server2's MySQL config but alas it was already running MySQL Server 5.6. Just to be thorough (in reality this took me several days to realize), I decided to check MySQL Connecter and discovered that my local machine's was version 6.8.3 while server1's was version 5.6. After I updated Connector, I published my web app and it ran without flaw!
Simple Explanation
Not only will this error be caused by a MySQL version disagreement between Entity Framework and MySQL Server, but also between Entity Framework and MySQL Connector!

How to fix a MySQL syntax error when deploying a working Play application to CloudBees?

I have very simple Play application that illustrates the use of MySQL (rather than the default H2) database available here:
https://github.com/ics-software-engineering/play-example-mysql
The README file explains the steps required to run the application locally using a local installation of MySQL. It works fine locally.
I have been trying unsuccessfully to get this application to work on CloudBees. My basic strategy has been:
Use the CloudBees Play 2 ClickStart to create a sample app, db, repo, and build system.
Edit the build file to refer to my github repository.
Rebuild and redeploy.
More complete instructions on this strategy are available here.
When I go through this process, the system builds and deploys, but gets a MySQL syntax error in the application console when I attempt to retrieve the home page:
[ [37minfo [0m] play - database [default] connected at jdbc:mysql://ec2-23-21-211-172.compute-1.amazonaws.com:3306/play-example-mys
[ [31merror [0m] play - 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 page_retrieval_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
#6f3k8cj6c: Database 'default' is in inconsistent state!
at play.api.db.evolutions.Evolutions$.checkEvolutionsState(Evolutions.scala:177)
This is a curious error because the syntax error "sequence page_retrieval_seq" is quite similar to one of the lines generated by Play in 1.sql when the database is the default (H2):
create sequence page_retrieval_seq
Unfortunately, this line is not actually in my 1.sql file, and I do not get this error when I run the system locally. I am running MySQL Ver 14.14 Distrib 5.6.12, for osx10.7 (x86_64).
I recognize that for production use, it is not advisable to enable automatic evolutions, but that is not the problem I want to solve here. My goal is for the CloudBees application to provide a snapshot of the latest working version of the code, and for evolutions to work on CloudBees MySQL just like they work for my local MySQL installation.
I have tried the steps outlined in this answer but it does not work on CloudBees, and anyway my current code already works correctly on a local installation of MySQL.
Why does my simple Play application not deploy correctly on CloudBees, and how can I fix it?
There appears to be a problem with play running evolutions incorrectly when ebean involved when running play in "production mode"
https://github.com/playframework/playframework/issues/1410
I have tested evolutions and they work even in production mode as long as ebean isn't used.
In any case, running evolutions in a production app is less than advisable, which is probably why this bug hasn't been picked up until now.
I updated the docs: https://developer.cloudbees.com/bin/view/RUN/Playframework with info on connecting to the database from anywhere, so you can run evolutions from the desktop or from Jenkins etc.
So run in something closer to play framework prod mode run "play start" to see this behavior for yourself.
Also, it appears JPA has wider use for ORM: https://github.com/typesafehub/play-spring-data-jpa
EDIT: Yeah im wrong, mis-read!
====================
As far as I know MySQL does not support sequences.
http://dev.mysql.com/doc/refman/5.6/en/faqs-general.html#qandaitem-B-1-1-6
mysql> create sequence test;
ERROR 1064 (42000): 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 blag' at line 1