Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Error : php artisan snapshot: load db_name #133

Unanswered
jnkodo asked this question in Q&A
Discussion options

Symfony\Component\ErrorHandler\Error\FatalError

Allowed memory size of 536870912 bytes exhausted (tried to allocate 186770585 bytes)
image

You must be logged in to vote

Replies: 2 comments

Comment options

Probably, you figured this out but you want to use the stream option:

php artisan snapshot:load danapay-api-dump --stream

By default, snapshot:load will load the entire snapshot into memory which may cause problems when using large files. To avoid this, you can pass the --stream option to stream the snapshot to the database one statement at a time.

You must be logged in to vote
0 replies
Comment options

I had an issue where INSERT statements (restoring db) where failing without a real reason (export syntax was ok). Figured out MySQL couldn't load the query (single line) in memory and just failed halfway through.

This fixed it (in config/database.php on the MySQL connection):

 'dump' => [
 // Prevent long INSERT statements when snapshotting database (25MB)
 'addExtraOption' => '--max-allowed-packet=25000000 --net_buffer_length=25000000',
 ],

Export again after this. It sets the maximum buffer to 25MB so single-line INSERT and other statements don't exceed that limit.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #130 on November 14, 2022 12:17.

AltStyle によって変換されたページ (->オリジナル) /