What about:

grep -v 'SET SQL_MODE' < test.sql >test-removed.sql


On 11/12/2022 6:11 pm, Piers Rowan via luv-main wrote:
Maybe some progress but this works on a test file:

sed -i 's/SET SQL_MODE/-- SET SQL_MODE/g' test.sql

I am looking at stopping at the first occurrence so to not have to scan the while file.

There are a couple of suggestions but I need to be sure before touching production data.

Thanks

Piers


On 11/12/22 16:58, Piers Rowan via luv-main wrote:
Hi there,

I have only used sed in a copy and paste basic way.

If I open this file in vi it crashes on saving. Size = 4.6G

This is a MySQL back up (and too large to transfer before the client needs it) - ie "correct" the data.

I just need a way of setting:

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; > -- SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";

Or removing it entirely.

Ideally I could just use vi but it has crashed sever times so I am looking for (any) other ideas.

Many thanks

Piers


_______________________________________________
luv-main mailing list -- [email protected]
To unsubscribe send an email to [email protected]
_______________________________________________
luv-main mailing list -- [email protected]
To unsubscribe send an email to [email protected]

--
Thanks
Andrew

_______________________________________________
luv-main mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to