I have a database including some tables, when I want to delete data from tables which includes an «Auto Increment» field, using this query:
delete from test.table1 ;
I got this error:
Error Code: 1030Got error -1 from storage engine
Why this happens? What should I do?
OMG Ponies
321k79 gold badges517 silver badges499 bronze badges
asked Nov 1, 2010 at 8:24
2
Try to change innodb_force_recovery
value (in your /etc/my.cnf
).
Error -1 says NOTHING. Without your tables creation code (SHOW CREATE TABLE table_name
) can not say where exactly problem is.
answered Nov 1, 2010 at 14:34
ksogorksogor
8532 gold badges7 silver badges15 bronze badges
1
You also get this error, if your file system is full.
answered Sep 11, 2013 at 18:40
ToBe_HHToBe_HH
6586 silver badges9 bronze badges
1
I just got this one and it was due to the fact that the new folder on the SSD drive where I wanted the new table to go was created under root and mysql runs under the mysql user. So
cd to your data folder
chown mysql .
and it solves the problem.
answered Jan 29, 2014 at 21:48
Randall StevensRandall Stevens
5961 gold badge8 silver badges20 bronze badges
Go to /etc/my.cnf or /etc/mysql/my.cnf
Comment line innodb_force_recovery=1
Save the file and restart mysql
answered Jun 12, 2015 at 11:34
answered Nov 1, 2010 at 8:51
Haim EvgiHaim Evgi
122k45 gold badges215 silver badges223 bronze badges
1
I also met this error while deleting 2 rows from an Innodb table, only 2 particular rows can’t be deleted. I Google the error, but can’t find better solutions.
So i tried this:
-
Create a backup for my db (exporting db).
-
Re-Installing MySQL Server
-
Restoring my db (importing db).
-
Then there is no -1 engine error on deletion/update.
Success…
I think the error may occur due to invalid configuration of MySQL server with respect to storage engines.
Thank You….
Tony Stark
8,0248 gold badges43 silver badges63 bronze badges
answered May 1, 2013 at 7:07
FIXED!! check your memory by df -h
. also check inodes df -i
. if its full, delete some files.
answered Sep 22, 2016 at 5:44
MaxMax
1,52021 silver badges31 bronze badges
I see no answer has been selected as the right answer.
I found that in our database config we had the innodb_force_recovery configured.
Once we disabled / commented it out, the queries ran as expected.
answered May 17, 2017 at 9:29
EnzoEnzo
313 bronze badges
4
Find the value of innodb_force_recovery
at /etc/mysql/my.cnf
(for linux). if it is 0, remove it or comment it out.
Example
innodb_force_recovery = 0
change it to:
#innodb_force_recovery = 0
Reference:
InnoDB: innodb_force_recovery is on: we do not allow InnoDB: database
modifications by the user.
answered Dec 31, 2018 at 19:40
Lav PatelLav Patel
9771 gold badge7 silver badges12 bronze badges
For me the problem was solved by restarting my database (in my case Mariadb).
systemctl restart mariadb
answered Mar 30, 2020 at 7:30
Just modify to
#innodb_force_recovery = 1
It works to me.
Serjik
10.3k7 gold badges63 silver badges70 bronze badges
answered Nov 7, 2016 at 5:35
0
Here’s how I solved it, I just had the same error:
- Open Control Panel
- Select Unistall Programs
- Right click and select»Uninstall» on Microsoft Visual Basic Tools
- Restart your PC
dbc
98.9k20 gold badges214 silver badges322 bronze badges
answered Dec 31, 2018 at 19:29
1
Click here follow the steps to fix Mysql Got Error 1 From Storage Engine 1030 and related errors.
|
|
To Fix (Mysql Got Error 1 From Storage Engine 1030) error you need to |
|
Step 1: |
|
---|---|
Download (Mysql Got Error 1 From Storage Engine 1030) Repair Tool |
|
Step 2: |
|
Click the «Scan» button | |
Step 3: |
|
Click ‘Fix All‘ and you’re done! | |
Compatibility:
Limitations: |
Mysql Got Error 1 From Storage Engine 1030 Error Codes are caused in one way or another by misconfigured system files
in your windows operating system.
If you have Mysql Got Error 1 From Storage Engine 1030 errors then we strongly recommend that you
Download (Mysql Got Error 1 From Storage Engine 1030) Repair Tool.
This article contains information that shows you how to fix
Mysql Got Error 1 From Storage Engine 1030
both
(manually) and (automatically) , In addition, this article will help you troubleshoot some common error messages related to Mysql Got Error 1 From Storage Engine 1030 error code that you may receive.
Note:
This article was updated on 2023-02-03 and previously published under WIKI_Q210794
Contents
- 1. What is Mysql Got Error 1 From Storage Engine 1030 error?
- 2. What causes Mysql Got Error 1 From Storage Engine 1030 error?
- 3. How to easily fix Mysql Got Error 1 From Storage Engine 1030 errors
What is Mysql Got Error 1 From Storage Engine 1030 error?
The Mysql Got Error 1 From Storage Engine 1030 error is the Hexadecimal format of the error caused. This is common error code format used by windows and other windows compatible software and driver vendors.
This code is used by the vendor to identify the error caused. This Mysql Got Error 1 From Storage Engine 1030 error code has a numeric error number and a technical description. In some cases the error may have more parameters in Mysql Got Error 1 From Storage Engine 1030 format .This additional hexadecimal code are the address of the memory locations where the instruction(s) was loaded at the time of the error.
What causes Mysql Got Error 1 From Storage Engine 1030 error?
The Mysql Got Error 1 From Storage Engine 1030 error may be caused by windows system files damage. The corrupted system files entries can be a real threat to the well being of your computer.
There can be many events which may have resulted in the system files errors. An incomplete installation, an incomplete uninstall, improper deletion of applications or hardware. It can also be caused if your computer is recovered from a virus or adware/spyware
attack or by an improper shutdown of the computer. All the above actives
may result in the deletion or corruption of the entries in the windows
system files. This corrupted system file will lead to the missing and wrongly
linked information and files needed for the proper working of the
application.
How to easily fix Mysql Got Error 1 From Storage Engine 1030 error?
There are two (2) ways to fix Mysql Got Error 1 From Storage Engine 1030 Error:
Advanced Computer User Solution (manual update):
1) Start your computer and log on as an administrator.
2) Click the Start button then select All Programs, Accessories, System Tools, and then click System Restore.
3) In the new window, select «Restore my computer to an earlier time» option and then click Next.
4) Select the most recent system restore point from the «On this list, click a restore point» list, and then click Next.
5) Click Next on the confirmation window.
6) Restarts the computer when the restoration is finished.
Novice Computer User Solution (completely automated):
1) Download (Mysql Got Error 1 From Storage Engine 1030) repair utility.
2) Install program and click Scan button.
3) Click the Fix Errors button when scan is completed.
4) Restart your computer.
How does it work?
This tool will scan and diagnose, then repairs, your PC with patent
pending technology that fix your windows operating system registry
structure.
basic features: (repairs system freezing and rebooting issues , start-up customization , browser helper object management , program removal management , live updates , windows structure repair.)
█ 13.05.2019 10:44
Попробовал этот скрипт, он скачал с сервера установочные файлы, но при создании БД ругается
ERROR 1030 (HY000) at line 1: Got error -1 from storage engine
Если автор или кто-то, в нем копавшийся, заглянет, подскажите, пожалуйста, в чем дело. Может, он уже доработан, и новая версия есть, я просто давно не проверял.
█ 13.05.2019 15:37
я не пробовал, но подозреваю неправильные пути для создания базы…
█ 16.06.2019 11:08
Еще на одной кассе попробовал, теперь прочитал внимательнее.
Видно, что ukm.sql отработал, и ошибка возникает на setver.sql. Пропустил его. База создалась, ukmclient запустился и пишет «КОД НЕИЗВЕСТЕН НЕИЗВЕСТНАЯ ОШИБКА Can not convert » to j».
Видимо, осталось разобраться, что неверно в setver.sql, и дальше уже просить совета у разработчика.
setver.sql:
SQL код:
replace into ukm_ukmversion(version, moment, cli_updates_version) values (83000, NOW(), 83000);
█ 16.06.2019 11:32
может, несовпадение версий или структуры?
█ 16.06.2019 11:38
Гм. После перезагрузки кассы ошибка изменилась.
КОД НЕИЗВЕСТЕН НЕИЗВЕСТНАЯ ОШИБКА Query failed: Error(1146) Table ‘ukmclient.ukm_ukmversion’ doesn’t exist: SQL SELECT MAX(version) FROM ukm_ukmversion
Захожу в mysql, не пойму, что за глюк.
Код:
192.168.13.101#mysql --user=root --password=CtHDbCGK.C Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 21 Server version: 5.0.67 Source distribution Type 'help;' or 'h' for help. Type 'c' to clear the buffer. mysql> use ukmclient; Database changed mysql> show tables; +-------------------------------------------+ | Tables_in_ukmclient | +-------------------------------------------+ | auth_bpc_journal | | auth_gpb_journal | | auth_internal_journal | ................... | trm_out_table_operations | | trm_out_updates_download_state | | trm_out_webmoney_sequence | | ukm_job_scheduler | | ukm_operation_processing | | ukm_ukmversion | | wbn_event | | wbn_session | +-------------------------------------------+ 610 rows in set (0,07 sec) mysql> select * from ukm_ukmversion; ERROR 1146 (42S02): Table 'ukmclient.ukm_ukmversion' doesn't exist mysql> select * from wbn_event; ERROR 1146 (42S02): Table 'ukmclient.wbn_event' doesn't exist mysql> select * rom trm_in_store; ERROR 1146 (42S02): Table 'ukmclient.trm_in_store' doesn't exist mysql>
Переставил еще раз. Уже нет этого глюка.
Код:
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | | ukmclient | +--------------------+ 4 rows in set (0,00 sec) mysql> select * from ukmclient.ukm_ukmversion; Empty set (0,00 sec) mysql> use ukmclient; Database changed mysql> select * from ukm_ukmversion; Empty set (0,00 sec)
Осталось понять, что за проблема вставить строчку в таблицу.
SQL код:
mysql> replace into ukm_ukmversion(version, moment, cli_updates_version) values (83000, NOW(), 83000);
ERROR 1030 (HY000): Got error -1 from storage engine
mysql> insert into ukm_ukmversion(version, moment, cli_updates_version) values (83000, NOW(), 83000);
ERROR 1030 (HY000): Got error -1 from storage engine
█ 16.06.2019 11:40
На другой рабочей кассе смотрю.
SQL код:
mysql> select * from ukm_ukmversion;
+---------+--------------+---------------------+---------------------+
| version | full_version | moment | cli_updates_version |
+---------+--------------+---------------------+---------------------+
| 74000 | | 2017-01-13 19:55:00 | 74000 |
| 75000 | | 2017-05-14 11:34:36 | 75000 |
| 75001 | | 2017-05-14 11:34:47 | 75001 |
| 78000 | | 2018-02-06 11:35:32 | 78000 |
| 78001 | | 2018-02-06 11:35:33 | 78001 |
| 78002 | | 2018-02-06 11:35:43 | 78002 |
| 83000 | | 2018-12-18 15:12:57 | 83000 |
| 83001 | | 2018-12-18 15:12:58 | 83001 |
| 83002 | | 2018-12-18 15:12:58 | 83002 |
| 83003 | | 2018-12-18 15:13:12 | 83003 |
+---------+--------------+---------------------+---------------------+
10 rows in set (0,00 sec)
mysql>
На этой не хочет.
SQL код:
mysql> replace into ukm_ukmversion(version, full_version, moment, cli_updates_version) values (83000, null, NOW(), 83000);
ERROR 1048 (23000): Column 'full_version' cannot be null
mysql> replace into ukm_ukmversion(version, full_version, moment, cli_updates_version) values (83000, 83000, NOW(), 83000);
ERROR 1030 (HY000): Got error -1 from storage engine
█ 16.06.2019 11:56
SQL код:
mysql> insert into ukm_ukmversion values (83000, '83000', NOW(), 83000);
ERROR 1030 (HY000): Got error -1 from storage engine
mysql> CREATE TABLE ukm_test (
-> version int(10) unsigned NOT NULL default '0', -- Идентификатор версии
-> full_version varchar(15) NOT NULL default '', -- Полный номер версии
-> moment datetime NOT NULL default '0000-00-00 00:00:00', -- Дата установки версии
-> cli_updates_version int(10) unsigned NOT NULL default '0' -- Версия клиентских обновлений
-> );
Query OK, 0 rows affected (0,07 sec)
mysql>
mysql> insert into ukm_test values (83000, '', NOW(), 83000);
Query OK, 1 row affected (0,00 sec)
mysql> insert into ukm_ukmversion select * from ukm_test;
ERROR 1030 (HY000): Got error -1 from storage engine
mysql> select * from ukm_test;
+---------+--------------+---------------------+---------------------+
| version | full_version | moment | cli_updates_version |
+---------+--------------+---------------------+---------------------+
| 83000 | | 2019-06-16 11:54:18 | 83000 |
+---------+--------------+---------------------+---------------------+
1 row in set (0,00 sec)
mysql> drop table ukm_ukmversion;
Query OK, 0 rows affected (0,13 sec)
mysql> rename table ukm_test to ukm_ukmversion;
Query OK, 0 rows affected (0,00 sec)
mysql> select * from ukm_ukmversion;
+---------+--------------+---------------------+---------------------+
| version | full_version | moment | cli_updates_version |
+---------+--------------+---------------------+---------------------+
| 83000 | | 2019-06-16 11:54:18 | 83000 |
+---------+--------------+---------------------+---------------------+
1 row in set (0,00 sec)
mysql>
Загадка.
█ 16.06.2019 12:03
конфиг мускула покажи? место на дисках точно есть?
█ 16.06.2019 12:13
В конфиге забыл отключить set-variable=innodb_force_recovery=6
Полет нормальный.
█ 17.07.2019 12:22
я как разработчик скрипта, не ожидал что скрипт пойдет в массы…
Если у меня он перестанет работать исправлю и выложу новую версию.
Идея скрипта крайне проста он тупо качает инсталяционные файлы с сервера(ip сервера берем из rc.ukm) в котором лежат SQL скрипты необходимые для создания и настройки базы. Единственное что формируется самим скриптом это гранты.
P.S. Если часто пользуетесь этим скриптом, подчищайте директории бэкапов /usr/local/mysql/var_badXX. На больших базах может быстро забиться винт.
Часовой пояс GMT +3, время: 22:05.
Форум на базе vBulletin®
Copyright © Jelsoft Enterprises Ltd.
В случае заимствования информации гипертекстовая индексируемая ссылка на Форум обязательна.
Содержание
Ошибки
Foreign key / Внешние ключи / Ошибка #1217
Теория в другом месте. Только фикс.
Текст ошибки может быть разным
#1217 - Cannot DELETE OR UPDATE a parent ROW: a FOREIGN KEY CONSTRAINT fails\ #1217 - Невозможно удалить или обновить родительскую строку: проверка ограничений внешнего ключа не выполняется\ ERROR 1005 (HY000) at line 30: Can't create table (errno: 150) Create table %table_name% with foreign key constraint failed.
В mysql cli отключаем проверку внешних ключей, делаем нужный запрос, включаем обратно.
SET FOREIGN_KEY_CHECKS = 0; # пример, загрузка таблицы LOAD DATA INFILE '/path/to/table.txt' INTO TABLE TABLE_NAME; # пример, загрузка дампа SOURCE dump.sql; # пример, удаление таблицы DROP TABLE IF EXISTS users; # включаем проверку внешних ключей SET FOREIGN_KEY_CHECKS = 1;
UPD 1/08/2022
можно ещё проще сделать
mysql --login-path=user --init-command="SET SESSION FOREIGN_KEY_CHECKS=0;" < dump.sql
Run ‘systemctl daemon-reload’ to reload units
Warning: The unit file, source configuration file or drop-ins of mariadb.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
Помогло
mv /etc/systemd/system/mysql.service.d /etc/systemd/system/mariadb.service.d
Can’t init tc log
rm -f /var/lib/mysql/tc.log mv /var/lib/mysql/tc.log /var/lib/mysql/tc.log_BAK
MySQL “Got an error reading communication packet” errors
#1524 — Plugin ‘unix_socket’ is not loaded
Can’t create a new thread (errno 11)
Ошибка Can’t create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug
Как всегда ulimit — https://www.percona.com/blog/2013/02/04/cant_create_thread_errno_11/
TL;DR
Лимиты установленные для MySQL в файле /etc/security/limits.conf
будут переопределены файлом /etc/security/limits.d/90-nproc.conf
. Поэтому задавать лимиты нужно в 90-nproc.conf
или создать отдельный файл 91-mysql.conf
mysql soft nofile 10240 mysql hard nofile 40960 mysql soft nproc 10240 mysql hard nproc 40960
#1698 — Access denied for user ‘root’@’localhost’
Не работает phpmyadmin под root’ом. Для MySQL 127.0.0.1 и localhost это разные хосты.
Добавляем отдельного пользователя для администрирования
CREATE USER 'dxdydz'@'%' IDENTIFIED BY 'p4ssw0rd'; GRANT ALL PRIVILEGES ON *.* TO 'dxdydz'@'%' WITH GRANT OPTION;
ИЛИ
# mysql -u root mysql> use mysql; mysql> update user set plugin='' where User='root'; mysql> flush privileges; mysql> exit;
что-то там с sudo и unix_socket, не разбирался пока, но вариант рабочий.
mysqldump: Couldn’t execute ‘show events’
Ошибка mysqldump: Couldn’t execute ‘show events’: Cannot proceed because system tables used by Event Scheduler were found damaged at server start после перехода на MariaDB с MySQL 56 на cPanel сервере
mysql_upgrade по рекомендациям тоже не работает с ошибкой mysqldump: Got error: 1102: Incorrect database name ‘#mysql50#.config'» when selecting the database
И мне помог не cPanel, а Plesk
В /var/lib/mysql/
был каталог с точкой в имени.
Чтобы его найти выполним команду
# ls -la /var/lib/mysql| grep ^d | egrep '.'
Решение
Удалить/перенести каталог в другой место, выполнить mysql_upgrade.
#1214 — The used table type doesn’t support FULLTEXT indexes
Индексы FULLTEXT поддерживаются в таблицах InnoDB только начиная с MYSQL 5.6, поэтому попробуйте обновить MYSQL и после этого изменить команду таблицы
Waiting for table metadata lock
No directory, logging in with HOME=/
# /etc/init.d/mysql start No directory, logging in with HOME=/
Подобная ошибка была в Debian с репозиторием dotdeb.
Надо поправить /etc/passwd
# cat /etc/passwd | grep mysql mysql:x:112:117:MySQL Server,,,:/nonexistent:/bin/false
Должно быть так
mysql:x:106:110:MySQL Server,,,:/nonexistent:/bin/false
Can’t create thread to kill server (errno= 11)
Скорее всего на сервере недостаточно памяти для выбранных настроек в my.cnf
.
Т.е. key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections
в итоге получается больше чем RAM на сервере.
Решение — уменьшить max_connections и другие параметры исходя из доступных ресурсов.
Can’t create a new thread (errno 11)
Ошибка похожа на Can’t create thread to kill server и также связана с лимитами.
В данном случае нужно увеличить количество открытых файлов и количество процессов (nofile
и nproc
).
По-умолчанию open files
равен 1024.
Проверим, чтобы удостовериться
su - mysql -c 'ulimit -aHS' -s '/bin/bash'
Добавляем в файл /etc/security/limits.conf
* soft nproc 40960 * hard nproc 65535 * soft nofile 40960 * hard nofile 65535
Либо устанавливаем лимит только для mysql
mysql soft nofile 40960 mysql hard nofile 65535 mysql soft nproc 40960 mysql hard nproc 65535
UPD
Нашёл рекомендацию добавить лимиты в отдельный файл 99-mysql.conf
в каталоге /etc/security/limits.d/
unknown variable ‘default-tmp-storage-engine=MyISAM’
Host ‘a.b.c.d’ is blocked because of many connection errors; unblock with ‘myscladmin flush-hosts’
Fatal error: Uncaught exception ‘Exception’ with message ‘Error: Can’t open file: ‘./ocr/oc_product.frm’ (errno: 24)
# perror 24 OS error code 24: Too many open files
В логе mariadb.log
нечто подобное
170710 10:36:01 [ERROR] mysqld: Can't open file: './oc2_test/oc_user.frm' (errno: 24) 170710 10:36:01 [ERROR] mysqld: Can't open file: './oc2_test/oc_user_group.frm' (errno: 24) 170710 10:44:05 [ERROR] Error in accept: Too many open files
Решение — см. запись ниже open-files-limit в MariaDB
Текущее использование открытых файлов можно посмотреть так:
# lsof -u mysql | wc -l
InnoDB: mmap(137363456 bytes) failed; errno 12
Ошибка
InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137363456 bytes) failed; errno 12 InnoDB: Completed initialization of buffer pool InnoDB: Fatal error: cannot allocate memory for the buffer pool
Решение — уменьшить innodb_buffer_pool_size
или добавить RAM.
Правильный UTF-8
В 5.0 было так
default-character-set=utf8
а потом трахбах и deprecated
Теперь так
init_connect='SET collation_connection = utf8_unicode_ci' init_connect='SET NAMES utf8' character-set-server=utf8 collation-server=utf8_unicode_ci skip-character-set-client-handshake
#1146 — Table ‘data_dictionary.CHARACTER_SETS’ doesn’t exist
И опять убунта. Что за чудо система. Не даёт скучать. Сиди чини её нескончаемые баги. Впрочем ничего нового.
Делаем
sudo mysql_upgrade -u root -p --force
И всё начинает работать. До следующего адового бага. Продакшен реди итиху мать.
/usr/sbin/mysqld: Error on realpath() on ‘/var/lib/mysql-files’ (Error 2)
Баг после апгрейда встретился только в Ubuntu
ЕМНИП нужно просто создать каталог /var/lib/mysql-files
sudo mkdir /var/lib/mysql-files
‘ERROR 1214 (HY000) at line 784: The used table type doesn’t support FULLTEXT indexes ‘
FULLTEXT INDEX раньше работал только с MyISAM. С версии 5.6 доступен в InnoDB.
Так что либо апгрейд либо ALTER TABLE `yourtable` ENGINE = MyISAM;
Got an error from unknown thread, /builddir/build/BUILD /storage/myisam/mi_write.c:226
Также в логах может быть что-то вроде Incorrect key file for table ‘xyz.MYI’; try to repair it
Казалось бы следует сделать mysqlrepair –auto-repair
. Но обычно это не помогает.
Скорее всего нет инодов или кончилось место или недоступен tmpdir в mysql.
Проверяем df -i
и df -h
. Также проверяем значение tmpdir
в my.cnf
mysqldump: Got error: (Errcode: 24) when using LOCK TABLES
Узнал о крутой утилите perror. По коду ошибки покажет, что не так.
Print a description for a system error code or a MySQL error code. If you want to get the error for a negative error code, you should use -- before the first error code to tell perror that there was no more options.
Пример
# perror -v 24 OS error code 24: Too many open files
Ну и по ошибке выше — попробуйте добавить опцию --single-transaction
к mysqldump
Error Number: 1364
Через tcpdump выловил ошибку в php-fpm
MySQL Error! MySQL error in file: /engine/modules/tracker/upload.php at line 0 Error Number: <b>1364</b></div> The Error returned was: Field 'author2' doesn't have a default value SQL query: INSERT INTO dle_files (news_id, author) values ('0', 'dx')
Виной всему старый код и новый (5.7) MySQL.
Почему так
-
при вставке или обновлении данных у поля нет значения по-умолчанию
Быстрый фикс — выключить так называемый strict mode
Для этого нужно добавить в my.cnf
[mysqld] sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Можно также вынести в отдельный файл /etc/mysql/conf.d/disable_strict_mode.cnf
Проверить sql_mode
mysql -e "SELECT @@sql_mode;"
#1030 — Got error -1 from storage engine
При попытке выполнить SQL запрос в phpmyadmin получаем ошибку #1030 — Got error -1 from storage engine
Вероятно включен innodb_force_recovery
в файле my.cnf
.
Проверяем логи. Если есть нечто подобное
InnoDB: innodb_force_recovery is on: we do not allow InnoDB: database modifications by the user. Shut down
то значит так оно и есть. Выключаем innodb_force_recovery
и всё снова работает.
error: ‘Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)’
Ошибка
# /etc/init.d/mysql restart * Stopping MySQL database server mysqld [fail] * Starting MySQL database server mysqld [ OK ] /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
Смотрим пароль пользователя debian-sys-maint
в файле /etc/mysql/debian.cnf
[client] host = localhost user = debian-sys-maint password = A1b2C3d4E5f6 socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] user = debian-sys-maint password = A1b2C3d4E5f6 socket = /var/run/mysqld/mysqld.sock basedir = /usr
Выполняем 2 SQL запроса, чтобы вернуть гражданину debian-sys-maint его привилегии
# mysql -u root -p mysql> use mysql; mysql> GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'A1b2C3d4E5f6'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'A1b2C3d4E5f6' WITH GRANT OPTION;
Перезапускаем MySQL сервер
# /etc/init.d/mysql restart * Stopping MySQL database server mysqld [ OK ] * Starting MySQL database server mysqld [ OK ] * Checking for corrupt, not cleanly closed and upgrade needing tables.
open-files-limit в MariaDB
С приходом systemd жить стало лучше, жить стало веселее.
Systemd самостоятельно контролирует, сколько файлов служба (в нашем случае mariadb-server) может открыть, независимо от того, что вы настроили в /etc/my.cnf
или в /etc/security/limits.conf
.
Создаём каталог
# mkdir -p /etc/systemd/system/mariadb.service.d/
И вносим следующие правки
# cat /etc/systemd/system/mariadb.service.d/limits.conf [Service] LimitNOFILE=10240
Данные новшества однако документированы. Так что надо просто внимательнее читать release notes и changelog.
# cat /usr/lib/systemd/system/mariadb.service # It's not recommended to modify this file in-place, because it will be # overwritten during package upgrades. If you want to customize, the # best way is to create a file "/etc/systemd/system/mariadb.service", # containing # .include /lib/systemd/system/mariadb.service # ...make your changes here... # or create a file "/etc/systemd/system/mariadb.service.d/foo.conf", # which doesn't need to include ".include" call and which will be parsed # after the file mariadb.service itself is parsed. # # For more info about custom unit files, see systemd.unit(5) or # http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F # For example, if you want to increase mariadb's open-files-limit to 10000, # you need to increase systemd's LimitNOFILE setting, so create a file named # "/etc/systemd/system/mariadb.service.d/limits.conf" containing: # [Service] # LimitNOFILE=10000 # Note: /usr/lib/... is recommended in the .include line though /lib/... # still works. # Don't forget to reload systemd daemon after you change unit configuration: # root> systemctl --system daemon-reload
# systemctl --system daemon-reload # systemctl restart mariadb.service
Unable to lock ./ibdata1, error: 11
В логах
InnoDB: Unable to lock ./ibdata1, error: 11 InnoDB: Check that you do not already have another mysqld process InnoDB: using the same InnoDB data or log files.
Решение в сети, которое якобы некоторым помогает
mv ibdata1 ibdata1.bak cp -a ibdata1.bak ibdata1
увы не помогает.
Бытует мнение, что виной всему Apparmor т.к. нигде кроме Ubuntu ошибка эта не встречалась
Можно попробовать добавить в /etc/apparmor.d/usr.sbin.mysqld
/var/lib/mysql/data/ r, /var/lib/mysql/data/** rwk,
надо проверить
unknown option ‘—skip-locking’
Опцию –skip-locking
убрали в MySQL 5.5.
Решение: заменить skip-locking
на skip-external-locking
Thread stack overrun
Ошибка
#1436 - Thread stack overrun: 8240 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack.
Добавляем в секцию [mysqld]
thread_stack = 256K
Не работает mysql_upgrade
5.1 > 5.5
5.5 > 5.6
Ошибка
root@mx:/etc/mysql# mysql_upgrade -u root -p Enter password: Looking for 'mysql' as: mysql Looking for 'mysqlcheck' as: mysqlcheck Error: Failed while fetching Server version! Could be due to unauthorized access. FATAL ERROR: Upgrade failed
Решение
mysql_upgrade -S /var/lib/mysql/mysql.sock -uUSERNAME -p
#23 — Out of resources when opening file
#23 — Out of resources when opening file Errcode: 24 — Too many open files
#1273 — unknown collation
Ошибка error #1273 — Unknown collation: ‘utf8mb4_unicode_ci’
Почему такое произошло? Вероятно вы пытаетесь использовать дамп базы с более новой версии MySQL сервера где уже есть поддержка utf8mb4.
Вероятно вы уже видели в сети совет — открыть дамп через каким-нибудь Notepad++ и заменить все utf8mb4_unicode_ci
на utf8_general_ci
Так делать НЕ НАДО!
Вариантов много — обновить MySQL (в версиях выше 5.5.3 такой проблемы нет) или использовать совместимость со старыми версиями MySQL при дампе (mysqldump –compatible=mysql4).
Подробнее на stackoverflow.
Got error 28 from storage engine
Скорее всего у вас просто закончилось свободное место на диске — strerror(28) = No space left on device
Коды ошибок strerror на память
strerror(0) = Success strerror(1) = Operation not permitted strerror(2) = No such file or directory strerror(3) = No such process strerror(4) = Interrupted system call strerror(5) = Input/output error strerror(6) = No such device or address strerror(7) = Argument list too long strerror(8) = Exec format error strerror(9) = Bad file descriptor strerror(10) = No child processes strerror(11) = Resource temporarily unavailable strerror(12) = Cannot allocate memory strerror(13) = Permission denied strerror(14) = Bad address strerror(15) = Block device required strerror(16) = Device or resource busy strerror(17) = File exists strerror(18) = Invalid cross-device link strerror(19) = No such device strerror(20) = Not a directory strerror(21) = Is a directory strerror(22) = Invalid argument strerror(23) = Too many open files in system strerror(24) = Too many open files strerror(25) = Inappropriate ioctl for device strerror(26) = Text file busy strerror(27) = File too large strerror(28) = No space left on device strerror(29) = Illegal seek strerror(30) = Read-only file system strerror(31) = Too many links strerror(32) = Broken pipe strerror(33) = Numerical argument out of domain strerror(34) = Numerical result out of range strerror(35) = Resource deadlock avoided strerror(36) = File name too long strerror(37) = No locks available strerror(38) = Function not implemented
ERROR 2006 (HY000) — MySQL server has gone away
Добавить в секцию [mysqld]
max_allowed_packet = 64M
Значение по-умолчанию = 1М
Скорее всего поможет. Если нет, то также в секцию [mysqld]
wait_timeout = 3600
Значение по-умолчанию — 300 проверить
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies