LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2023, 07:37 AM   #1
Bolshedvorskii
LQ Newbie
 
Registered: Jul 2023
Location: Russia, Moscow
Distribution: Debian, ZorinOS, Astra Linux
Posts: 16

Rep: Reputation: 0
Question MySQL 5.5.55 backup from .gz archive


Hi guys!

I need to recover MySQL database via .gz archive.
But I got this error:
Code:
root@test-udprf:/var/data# zcat /var/data/20230726_sql.gz | mysql -uroot -ppassword udprf
ERROR 1071 (42000) at line 57: Specified key was too long; max key length is 767 bytes
I found in Google how to fix it (Add a few lines at /etc/my.cnf)
But here other problem: I installed MySQL 5.5.55 from source.
Installation directory is /usr/local/mysql
There is no my.cnf in system by default.

If there are no configuration files in the system, where does MySQL get the standard configuration from?
I checked the mysql.server daemon for any tips, but I still don't understand how to create a configuration file and the most important thing is that MySQL would understand this and start working with it.
 
Old 07-27-2023, 08:15 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
probably that was my.ini that time, not my.cnf (or my*.ini)
You need to know your system, you need to find the location.
 
Old 07-27-2023, 12:07 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,173
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
I found in Google how to fix it (Add a few lines at /etc/my.cnf)
But here other problem: I installed MySQL 5.5.55 from source.
Installation directory is /usr/local/mysql
There is no my.cnf in system by default.

If there are no configuration files in the system, where does MySQL get the standard configuration from?
I checked the mysql.server daemon for any tips, but I still don't understand how to create a configuration file and the most important thing is that MySQL would understand this and start working with it.
There are some sample config files under /usr/local/mysql/support-files in the mysql binary installation. You can choose one that matches your setup and put it in /etc/my.cnf

By default mysql looks first for /etc/my,cnf. There are also other locations as mentioned in Table 4.2 where mysql looks also for a config file.
 
Old 07-28-2023, 03:12 AM   #4
Bolshedvorskii
LQ Newbie
 
Registered: Jul 2023
Location: Russia, Moscow
Distribution: Debian, ZorinOS, Astra Linux
Posts: 16

Original Poster
Rep: Reputation: 0
Okay, I set up the my.cnf and it seems to mysql work with this.

Solution from Google:
Add a few lines in [mysqld] case
innodb_large_prefix=on
innodb_file_format=Barracuda

Also I tried "mysql> set global innodb_large_prefix=on;"
and "mysql> set global innodb_file_format=Barracuda;"
--------------------------------------------------------------------------------------
Unfortunately this solution not help me, I still got that error.
Code:
root@test-udprf:/home/a.bolshedvorskii# zcat /var/data/20230726_sql.gz | mysql -uroot -ppassword udprf
ERROR 1071 (42000) at line 57: Specified key was too long; max key length is 767 bytes
Any ideas how to fix it?
 
Old 07-28-2023, 07:28 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,173
Blog Entries: 1

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
Originally Posted by Bolshedvorskii View Post
Okay, I set up the my.cnf and it seems to mysql work with this.

Solution from Google:
Add a few lines in [mysqld] case
innodb_large_prefix=on
innodb_file_format=Barracuda

Also I tried "mysql> set global innodb_large_prefix=on;"
and "mysql> set global innodb_file_format=Barracuda;"
--------------------------------------------------------------------------------------
Unfortunately this solution not help me, I still got that error.
Code:
root@test-udprf:/home/a.bolshedvorskii# zcat /var/data/20230726_sql.gz | mysql -uroot -ppassword udprf
ERROR 1071 (42000) at line 57: Specified key was too long; max key length is 767 bytes
Any ideas how to fix it?
I think you should upgrade mysql to version 5.7.x, because it doesn't have this limitation. Besides if the key in your backup gives this error, the backup is more likely made from a higher mysql version that 5.5.x.

Anyway if that's not an option, you should go to line 57 of the sql file and add a length for the key.
See this for details, but make sure you make a good backup of the sql file before start messing around with it...
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to archive torrent file + the iso files , like the ova archive of virtual box jheengut Linux - Software 2 12-22-2013 05:04 PM
Windows Backup Software (diff backup without archive bit) nkhajanchi.mg@gmail.com Linux - Software 4 09-09-2009 09:29 AM
[SOLVED] How do I change ca.archive.ubuntu.com to ca2.archive.ubuntu.com at the command line kennymw Linux - Newbie 3 09-01-2009 02:52 AM
importing an MS Outlook archive archive.pst alloydog Linux - Software 2 08-29-2003 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration