radiobrowser-api-rust icon indicating copy to clipboard operation
radiobrowser-api-rust copied to clipboard

Unable to import the SQL dump

Open raisen opened this issue 3 years ago • 2 comments

Steps to reproduce:

wget https://backups.radio-browser.info/latest.sql.gz
gunzip latest.sql.gz
docker run -i --rm -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=radio -v $(pwd)/latest.sql:/docker-entrypoint-initdb.d/latest.sql -p 3306:3306 mysql

mysql server error I'm receiving: ERROR 1146 (42S02) at line 606: Table 'radio.StationCheckHistory' doesn't exist

Line 606 at the time when this issue was opened is:

/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`radiouser`@`%` SQL SECURITY DEFINER */
/*!50001 VIEW `StationCheck` AS select `StationCheckHistory`
(truncated)

It looks like the view is being created before the table StationCheckHistory.

Removing the SQL statements to create the view fixed the issue and database was initialized correctly.

raisen avatar Nov 26 '21 00:11 raisen

Hi

If anyone could fix the backup.sh file that would be great. (https://github.com/segler-alex/radiobrowser-api-rust/blob/master/deployment/backup.sh)

Maybe by modifying it in this way ? 😐

mysqldump ${DBNAME} --ignore-table=${DBNAME}.StationCheck --ignore-table=${DBNAME}.StationCheckHistory  --ignore-table=${DBNAME}.StationClick > ${NAME}
mysqldump --no-data ${DBNAME} StationCheckHistory StationClick >> ${NAME}
mysqldump ${DBNAME} StationCheck >> ${NAME}

GHbasicuser avatar Jul 07 '22 11:07 GHbasicuser

Noob question?

How to run the Deployment script?

i am also having same error when trying import latest.sql.

Please help!

dardaniaa0 avatar Aug 31 '22 03:08 dardaniaa0