W
W
Walker20002021-12-28 07:51:34
MySQL
Walker2000, 2021-12-28 07:51:34

Mysql does not start (website on 1C-Bitrix Site Management). Looks like the base is corrupted. How can it be restored?

The site does not start, mysql does not start. A message that the database has not started is displayed on any page except the main one (it is loaded).

[Bitrix\Main\DB\ConnectionException]
Mysql connect error [127.0.0.1]: (2002) Connection refused (400)
/home/bitrix/www/bitrix/modules/main/lib/db/mysqliconnection.php:82
#0 : Bitrix\Main\DB\MysqliConnection->connectInternal()
/home/bitrix/www/bitrix/modules/main/lib/data/connection.php:53
#1: Bitrix\Main\Data\Connection->getResource()
/home/bitrix/www/bitrix/modules/main/lib/db/mysqlisqlhelper.php:21
#2: Bitrix\Main\DB\MysqliSqlHelper->forSql(string)
/home/bitrix/www/bitrix/modules/main /lib/config/option.php:193
#3: Bitrix\Main\Config\Option::load(string)
/home/bitrix/www/bitrix/modules/main/lib/config/option.php:38
#4: Bitrix\Main\Config\Option::get(string, string, string)
/home/bitrix/www/bitrix /modules/main/lib/httprequest.php:394
#5: Bitrix\Main\HttpRequest->prepareCookie(array)
/home/bitrix/www/bitrix/modules/main/lib/httprequest.php:71
#6: Bitrix \Main\HttpRequest->__construct(object, array, array, array, array)
/home/bitrix/www/bitrix/modules/main/lib/httpapplication.php:49
#7: Bitrix\Main\HttpApplication->initializeContext( array)
/home/bitrix/www/bitrix/modules/main/lib/application.php:130
#8: Bitrix\Main\Application->initializeExtendedKernel(array)
/home/bitrix/www/bitrix/modules/main/include .php:21
#9: require_once(string)
/home/bitrix/www/bitrix/modules/main/include/prolog_before.php:14
#10: require_once(string)
/home/bitrix/www/bitrix/modules/main/include/prolog.php:10
#11: require_once(string)
/home/bitrix/www/bitrix/header.php:1
#12: require(string)
/home/bitrix/www/catalog/index.php:2
#13: include_once(string)
/home/bitrix /www/bitrix/modules/main/include/urlrewrite.php:160
#14: include_once(string)
/home/bitrix/www/bitrix/urlrewrite.php:2

The /var/log/mysql/error.log file contains the following messages:

2021-12-28T04:42:48.871067Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 16238)
2021-12-28T04:42:48.871323Z 0 [Warning] Changed limits: table_open_cache: 2477 (requested
8096 ) 2021-12-28T04:42: 49.066759Z
0 [Note] /usr/sbin/mysqld (mysqld 5.7.33-36) starting as process 1615 ...
: PUNCH HOLE support available
2021-12-28T04:42:49.072080Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-12-28T04:42:49.072089Z 0 [Note] InnoDB: Uses event mutexes
2021-12 -28T04:42:49.072096Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-12-28T04:42:49.072104Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2021-12-28T04:42:49.072111Z 0 [Note] InnoDB: Using Linux native AIO
2021-12-28T04:42:49.072380Z 0 [Note] InnoDB: Number of pools:
1 Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-12-28T04:42:49.074495Z 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2021-12-28T04: 2021-12-28T04
:42:49.089702Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-12-28T04:42:49.101559Z 0 [Note] InnoDB: Recovering partial pages from the parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite
2021-12-28T04:42:49.105272Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-12-28T04:42:49.108314Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn
4280861412938
2021-12-28T04:42:49.129579Z 0 [Note] InnoDB: Database was not shutdown normally!
2021-12-28T04:42:49.129592Z 0 [Note] InnoDB: Starting crash recovery.
2021-12-28T04:42:49.142699Z 0 [Note] InnoDB: Created parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite, size 3932160 bytes
2021-12-28T04:42:49.147707Z 0 [ERROR] InnoDB: Trying to access page number 4294967295 in space 0, space name innodb_system, which is outside the tablespace bounds. Byte offset 0, len 16384, i/o type read. If you get this error at mysqld startup, please check that your my.cnf matches the ibdata files that you have in the MySQL server.
2021-12-28T04:42:49.147735Z 0 [ERROR] InnoDB: Server exits.

What could be the problem? HELP!!!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
Walker2000, 2021-12-28
@Walker2000

Here is the answer from the hoster that ended up working.
MySQL does not start due to the fact that tables were broken after the backup was restored.
Added the following line:
innodb_force-recovery=6
Then started the MySQL service.
Dumped the site database:
[[email protected] ~]# mysqldump --events --routines --triggers sitemanager > sitemanager.sql
[[email protected] ~]# ls -lha / root/sitemanager.sql
-rw-r--r-- 1 root root 298M Dec 28 04:38 /root/sitemanager.sql
But for correct operation it is necessary to reinitialize innodb and then restore the database from the dump. We can help you to re-initialize on the basis of paid hourly administration. Or you can do it yourself.
If you have a database dump that was taken before you did a restore, it's best to restore the database from that dump after you reinitialize innodb.
If not, then you can restore from the /root/sitemanager.sql dump.

P
pcdesign, 2021-12-28
@pcdesign

I had this. And just in case, I saved myself this algorithm of actions:
1) Add the following lines to my.cnf
port = 8881
innodb_force_recovery=3
innodb_purge_threads=0
2) Run
systemctl start mysql
3) Wait until everything is restored:
171229 14:10:41 InnoDB: Page checksum 2138135319 (32bit_calc: 1915668989), prior-to-4.0.14-form checksum 3309214847
InnoDB: stored checksum 2658474647, prior-to-4.0.14-form stored checksum 3309214847
InnoDB: Page lsn 0 0 2312264 of lsn at page end 2312264
InnoDB: Page number (if stored to page already) 0,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be a file space header page
InnoDB: Database page corruption on disk or a failed
InnoDB: file read of page 0.
InnoDB: You may have to recover from a backup.
InnoDB: It is also possible that your operating
InnoDB: system has corrupted its own file cache
InnoDB: and rebooting your computer removes the
InnoDB: error.
InnoDB: If the corrupt page is an index page
InnoDB: you can also try to fix the corruption
InnoDB: by dumping, dropping, and reimporting
InnoDB: the corrupt table. You can use CHECK
InnoDB: TABLE to scan your table for corruption.
InnoDB: See also dev.mysql.com/doc/refman/5.5/en/forcing-innodb-rec...
InnoDB: about forcing recovery.
171229 14:10:41 InnoDB: Waiting for the background threads to start
171229 14:10:42 Percona XtraDB ( www.percona.com ) 5.5.52-MariaDB-38.3 started; log sequence number 2313740
171229 14:10:42 InnoDB: !!! innodb_force_recovery is set to 3 !!!
171229 14:10:42 [Note] Plugin 'FEEDBACK' is disabled.
171229 14:10:42 [Note] Server socket created on IP: '0.0.0.0'.
171229 14:10:43 [Note] Event Scheduler: Loaded 0 events
171229 14:10:43 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.56-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 8881 MariaDB Server
4) Dump All databases.
5) Delete the drop database ...
6) Stop
systemctl stop mysql
7) Delete in /var/lib/mysql/
aria_log.00000001 aria_log_control ibdata1 ib_logfile0 ib_logfile1
8) Delete lines from my.cnf that have been added.
9) We reboot, create a new (old) database and restore from the dump
PS But in general - this is an alarming bell. Maybe something is wrong with the disk or memory.
It makes sense to transfer the base to another machine altogether.

R
Rsa97, 2021-12-28
@Rsa97

Restore the database from backups. Did you make regular backups and check the possibility of restoring from them?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question