- Date
- 1 min read
How to get around errors when importing a large database within MySQL
MySQL Error 1153 - Got a packet bigger than ‘max_allowed_packet’ bytes
Login to mysql using an alias such as:
alias mysql-login="mysql -h 127.0.0.1 -P 3306 -u {username} -p{password}"
Once logged in paste:
set global net_buffer_length=1000000;
set global max_allowed_packet=1000000000;
Run the command to import the database:
mysql -h 127.0.0.1 -P 3306 -u {username} -p{password}{the_name_of_the_local_database_here} < {your_export_sql_name_here}.sql
-
Christopher KelkerWeb Developer, blogger and gym enthusiast.