Announcement

#16 2016-03-22 00:21:36

Sharon
Member
Louisville, KY, USA
2016-03-01
10

Re: Piwigo and MySQL 5.7.11

Where is that file?

Offline

 

#17 2016-03-22 12:07:00

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo and MySQL 5.7.11

that a server config file from MySQL


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#18 2016-03-22 18:49:46

Sharon
Member
Louisville, KY, USA
2016-03-01
10

Re: Piwigo and MySQL 5.7.11

Did what you said, doesn't seem to make a difference.

Code:

Warning:  [mysql error 3065] Expression #1 of ORDER BY clause is not in SELECT list, references column 't.date_available' which is not in SELECT list; this is incompatible with DISTINCT


SELECT DISTINCT(image_id) FROM (SELECT *
    FROM piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 1
 ) AS t 
  ORDER BY date_available DESC, file ASC, id ASC
; in /piwigo/include/dblayer/functions_mysqli.inc.php on line 830


Fatal error: Call to a member function fetch_assoc() on a non-object in /piwigo/include/dblayer/functions_mysqli.inc.php on line 891

Offline

 

#19 2016-11-25 14:22:30

carrots
Member
2016-11-25
3

Re: Piwigo and MySQL 5.7.11

"Success story".

I upgraded my Piwigo server to from Debian Jessie to Ubunutu Xenial recently.
I haven't done any backups with mysqldump (yes, I am an idiot, totally forgot about this DB). Now I have only a file-level backup of /var/lib/mysql which have been taken when where was no usage of mysql at all (so should be consistent) and new mysql version on my server - mysql  Ver 14.14 Distrib 5.7.16, for Linux (x86_64)

I tried to restore:

apt-get install php-gd php-mysql
rsync -avP /backup_dir/var/lib/mysql/ /var/lib/mysql/ --delete
chown -R mysql:mysql /var/lib/mysql (this is just a quick-fix).
apt-get install mysql-server
service mysql stop

Now update root password in case you forgot it:

mysqld_safe --skip-grant-tables
  use mysql;
  update user set password=PASSWORD("new-pwd") where User='root';
  flush privileges;

Some MySQL magic:
mysql_upgrade -u root -p --force

Now I can login in Piwigo (even under Admin), but can't select an album, DB repair also doesn't work:

Warning:  [mysql error 3065] Expression #1 of ORDER BY clause is not in SELECT list, references column 'piwigo.piwigo_images.date_creation' which is not in SELECT list; this is incompatible with DISTINCT

SELECT DISTINCT(image_id)
  FROM piwigo_image_category
    INNER JOIN piwigo_images ON id = image_id
  WHERE
    category_id = 77
AND (category_id NOT IN (38,40,105,106,107,108,109,110,111,112,113,26,9,10,35,36,61))
  ORDER BY date_creation ASC, date_available ASC, file ASC
; in /mnt/arch/photo/piwigo/include/dblayer/functions_mysqli.inc.php on line 832


After this I checked upgrade status in admin panel, upgraded to Piwigo 2.8.3 and it started working!
DB  repair still returns an error:

Warning:  [mysql error 1067] Invalid default value for 'date'
ALTER TABLE piwigo_comments ORDER BY id; in /mnt/arch/photo/piwigo/include/dblayer/functions_mysqli.inc.php on line 845

Offline

 

#20 2016-11-25 15:30:44

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo and MySQL 5.7.11

you have the chance that we just released 2.8.3 which complies better with the default options of mysql 5.7 (error "... DISTINCT")
DB repair ? for what ? from what command?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#21 2016-11-25 15:32:44

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo and MySQL 5.7.11

and also how is the 'date' field in piwigo_comments?

for those who are reading, as carrots made, if you have access to mysql files, you can backup files directly but of course a dump for command line is much better


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#22 2016-11-25 15:41:36

carrots
Member
2016-11-25
3

Re: Piwigo and MySQL 5.7.11

flop25 wrote:

you have the chance that we just released 2.8.3 which complies better with the default options of mysql 5.7 (error "... DISTINCT")

Yes, it works, just wanted to post a "success story" on repairing from a very bad state - upgrading to 2.8.3 was not an obvious step.

flop25 wrote:

DB repair ? for what ? from what command?

Issued from UI because I was thinking it can help... because it is "repair", lol.

Offline

 

#23 2016-11-25 15:43:59

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo and MySQL 5.7.11

well thx for reporting
you might also try the repair from your mysql panel config ; if yous till have the error that might come Piwigo default value and mysql 5.7


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#24 2016-11-25 15:45:41

carrots
Member
2016-11-25
3

Re: Piwigo and MySQL 5.7.11

flop25 wrote:

and also how is the 'date' field in piwigo_comments?

mysql> desc piwigo_comments
    -> ;
Is this what you want?
+-----------------+-----------------------+------+-----+---------------------+----------------+
| Field           | Type                  | Null | Key | Default             | Extra          |
+-----------------+-----------------------+------+-----+---------------------+----------------+
| id              | int(11) unsigned      | NO   | PRI | NULL                | auto_increment |
| image_id        | mediumint(8) unsigned | NO   | MUL | 0                   |                |
| date            | datetime              | NO   |     | 0000-00-00 00:00:00 |                |
| author          | varchar(255)          | YES  |     | NULL                |                |
| email           | varchar(255)          | YES  |     | NULL                |                |
| author_id       | mediumint(8) unsigned | YES  |     | NULL                |                |
| anonymous_id    | varchar(45)           | NO   |     | NULL                |                |
| website_url     | varchar(255)          | YES  |     | NULL                |                |
| content         | longtext              | YES  |     | NULL                |                |
| validated       | enum('true','false')  | NO   |     | false               |                |
| validation_date | datetime              | YES  | MUL | NULL                |                |
+-----------------+-----------------------+------+-----+---------------------+----------------+


flop25 wrote:

for those who are reading, as carrots made, if you have access to mysql files, you can backup files directly but of course a dump for command line is much better

I am planning to write a script and a puppet module for this. Will publish it on this forum (if I succeed on fighting my laziness).

Offline

 

#25 2016-11-25 15:48:25

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo and MySQL 5.7.11

Thx
what is your sql_mode ?


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact