Errror 3554 while importing a .sql file
Asked Answered
F

6

20

ERROR 3554 (HY000) at line 318: Access to system table 'mysql.innodb_index_stats' is rejected.

Operation failed with exitcode 1 11:27:20 Import of C:\Users\VELOXSHOP\Downloads\dumpfilename.sql has finished with 1 errors

How do I allow acess to that table?

Fertilize answered 1/11, 2018 at 15:0 Comment(0)
S
21

You'll need to make a new dump/backup of your old database, this time remove those innodb tables from your target. You can do this by using --ignore-table parameter on the command line:

mysqldump -u root -p --all-databases --ignore-table=mysql.innodb_index_stats --ignore-table=mysql.innodb_table_stats > dump.sql

Then you should be able to restore your backup on the new database using the command below:

mysql -u root -p < dump.sql
Slight answered 21/11, 2019 at 4:8 Comment(0)
B
16

You can also circumvent this error using the --force option which causes mysql client to continue despite errors.

Becoming answered 30/7, 2020 at 15:46 Comment(1)
This is probably best as my old database is corrupted and don't have access - aka why I'm restoring a backup.Patriciate
P
8

Try to add -f to your command like so:

mysql -u root -p -f < dump.sql

-f means --force.

This did the trick for me!

Pilot answered 6/8, 2020 at 15:44 Comment(1)
Isn't that what Prazlin was also saying?Gaze
S
2

It seems to be restricted in Mysql 8. Remove the insert statement from the sql file. You may have to use sed if the file is very large

https://mcmap.net/q/325275/-how-to-ignore-certain-mysql-tables-when-importing-a-database

https://bugs.mysql.com/bug.php?id=92675

Spirituous answered 15/1, 2019 at 9:46 Comment(0)
K
0

That is a MySQL system table and it's unlikely that you should be inserting records into it directly. MySQL should update the table when it calculates new statistics for indexes when thresholds pass.

Inspect line 318 and figure out why it's trying to insert into that table.

Kelm answered 1/11, 2018 at 18:58 Comment(0)
A
-1

I had this issue when I made an export (mysqldump) using MySQL 5.7 and then accidentally tried to import it to MySQL 8.0. The correct sequence of events was to import the data into a MySQL 5.7 instance and then upgrade it to 8.0.

Angulation answered 26/3 at 13:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.