Automatyczna naprawa bazy danych

Forum przeznaczone dla osób poszukujących modyfikacji do phpBB 3.0.x oraz ich polskich lokalizacji.
Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: daroPL » 13 lipca 2009, 15:57

Polenie REPAIR TABLE odnosi się do popsutych tabel, a nie do tabel z nadmiarem.

Zawsze możesz sprawdzić czy ten "mod" działa wykonując zapytanie REPAIR TABLE nazwa_tabeli; dla tabeli, która po odpaleniu moda jest nadal popsuta.

Awatar użytkownika
@Marcin
Zasłużony
Posty: 1635
Rejestracja: 08 lutego 2009, 21:27
Lokalizacja: Nowa Ruda (PL) / Milton Keynes (UK)
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: @Marcin » 13 lipca 2009, 16:15

Czyli jak by to miało wygladać w praktyce? Musze to dodać do kodu? czy zapytanie w phpmyadminie wykonywać?
I jak dodac jeszcze optymalizacje?
Wsparcie phpBB PL !!

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: daroPL » 13 lipca 2009, 16:18

Wykonaj w phpMyAdminie dla tabeli, której nie naprawił ten skrypt i napisz czy jest tak jak chciałeś.

Awatar użytkownika
@Marcin
Zasłużony
Posty: 1635
Rejestracja: 08 lutego 2009, 21:27
Lokalizacja: Nowa Ruda (PL) / Milton Keynes (UK)
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: @Marcin » 13 lipca 2009, 16:20

wykonałem zapytanie: REPAIR TABLE phpbb_acl_groups; i działa :)
Wsparcie phpBB PL !!

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: daroPL » 13 lipca 2009, 16:30

Hmmm...to może spróbuj zmienić w podanym przez we3ba skrypcie

Kod: Zaznacz cały

mysql_query('REPAIR TABLE' . $row['table_name']);
na

Kod: Zaznacz cały

mysql_query('REPAIR TABLE ' . $row['table_name']);
może to wina zagubionej spacji.

Awatar użytkownika
@Marcin
Zasłużony
Posty: 1635
Rejestracja: 08 lutego 2009, 21:27
Lokalizacja: Nowa Ruda (PL) / Milton Keynes (UK)
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: @Marcin » 13 lipca 2009, 16:40

niestety nic się nie zmienia..
Wsparcie phpBB PL !!

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: daroPL » 13 lipca 2009, 16:43

To spróbuj między klamry po tym poleceniu mysql_query wstawić te dwie linie

Kod: Zaznacz cały

echo mysql_error();
echo mysql_errno();
i napisz czy coś pokazuje przy uruchamianiu skryptu oprócz "done"?

Awatar użytkownika
@Marcin
Zasłużony
Posty: 1635
Rejestracja: 08 lutego 2009, 21:27
Lokalizacja: Nowa Ruda (PL) / Milton Keynes (UK)
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: @Marcin » 13 lipca 2009, 17:14

wywaliło mi potężny błąd

Kod: Zaznacz cały

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 '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11064Done!
Wsparcie phpBB PL !!

Awatar użytkownika
daroPL
Zasłużony
Posty: 4564
Rejestracja: 24 czerwca 2005, 13:36
Lokalizacja: Poznań
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: daroPL » 13 lipca 2009, 18:07

Kod: Zaznacz cały

<?php

include 'config.php';

// Connect and select database
$link = mysql_connect($dbhost, $dbuser, $dbpasswd)
	or die(mysql_error());

mysql_select_db($dbname);

// Get tables list
$query = mysql_query('SHOW TABLES')
	or die(mysql_error());

// Save table to array and repair each table
while ($table = mysql_fetch_assoc($query)) {
	mysql_query('REPAIR TABLE ' . $table['Tables_in_' . $dbname]);
echo mysql_error() . '<br />';
echo mysql_errno() . '<br />';
}

// Result if no errors
echo 'Done!';

?>
zobacz czy to działa

Awatar użytkownika
@Marcin
Zasłużony
Posty: 1635
Rejestracja: 08 lutego 2009, 21:27
Lokalizacja: Nowa Ruda (PL) / Milton Keynes (UK)
Kontakt:

Re: Automatyczna naprawa bazy danych

Post autor: @Marcin » 13 lipca 2009, 18:21

hm, działa bo naprawiło a wynik jest taki:

Kod: Zaznacz cały

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0
Done!
Wsparcie phpBB PL !!

Zablokowany

Wróć do „Poszukiwania”