Question: **Problem:** I have database containing several lines of longtext fields to insert into a table containing 4,960,372 characters and keep getting **"Error code: 2103 Lost connection to MySQL server during query"**.

We are trying to restore a 16GB MySQL database, the table contains email header + email code.

Have exported form original database using: `mysqldump kayako < C:\temp\kayako.sql`

**Have Tried several ways to restore:**
1. Restore backup from file into SQL and set the max allowed packed size to 1GB using `mysqldump --max_allowed_packet=1G --opt -uroot -p -hpassword databasename > yourbackup.sql`

1. Using MySQL Workbench, MySQL Maestro
2. Splitting up the output file and importing each (only fails on these long inserts)

Please help, its so frustrating.

**Are there other ways to handle excessively long field inserts.**

info:

```
Product = Kayako Fusion
DEFAULT CHARACTER SET = utf8 COLLATE utf8_unicode_ci
max_allowed_packet = 1G
Columns:
   parserlogdataid  int(11) AI PK
   parserlogid      int(11)
   contents         longtext

```

Answer: 
Check if the user **1598934\_user** exists in the database. If it does exists, run the following mysql query to grant privileges.

```
GRANT ALL PRIVILEGES ON `postsData`.* TO '1598934_user'@'%';
FLUSH PRIVILEGES;

```

or if you do not want to grant all privileges then use:

```
GRANT <privileges> ON postsData.* TO '1598934_user'@'%' IDENTIFIED BY 'password';

```

or use:

```
GRANT INSERT, SELECT, DELETE, UPDATE ON postsData.* TO '1598934_user'@'%' IDENTIFIED BY 'password';

```

This should give privileges to the user

Also, if the user does not exists follow the query:

```
CREATE USER '1598934_user'@'%' IDENTIFIED BY 'password';

```

and follow the grant privileges query to give privileges.

Also, if you do not have access to run the above queries, use server name as `localhost` and upload your site contents / files to the host and run from the host.
Reset your Database password, it happens when password is wrong.