MySQL server has gone away on XAMPP - mysql

MySQL server has gone away is coming after I open site on localhost.
Following is the log file.
2022-02-17 11:28:12 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-02-17 11:28:12 0 [Note] InnoDB: Uses event mutexes
2022-02-17 11:28:12 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-02-17 11:28:12 0 [Note] InnoDB: Number of pools: 1
2022-02-17 11:28:12 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-02-17 11:28:12 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-02-17 11:28:12 0 [Note] InnoDB: Completed initialization of buffer pool
2022-02-17 11:28:12 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=588169799
2022-02-17 11:28:13 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-02-17 11:28:13 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-02-17 11:28:13 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-02-17 11:28:13 0 [Note] InnoDB: Setting file 'E:\xampp2\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-02-17 11:28:13 0 [Note] InnoDB: File 'E:\xampp2\mysql\data\ibtmp1' size is now 12 MB.
2022-02-17 11:28:13 0 [Note] InnoDB: Waiting for purge to start
2022-02-17 11:28:13 0 [Note] InnoDB: 10.4.20 started; log sequence number 588169808; transaction id 462509
2022-02-17 11:28:13 0 [Note] InnoDB: Loading buffer pool(s) from E:\xampp2\mysql\data\ib_buffer_pool
2022-02-17 11:28:13 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-02-17 11:28:13 0 [Note] InnoDB: Cannot open 'E:\xampp2\mysql\data\ib_buffer_pool' for reading: No such file or directory
2022-02-17 11:28:13 0 [Note] Server socket created on IP: '::'.

Solved.
After trying for hours I am able to solve now. localhost site not opening, phpmyadmin was also not working.
What didn't work. I tried changing port from 3306 to 3307 in xampp config and php config file but this didn't help (after checking youtube, other similar questions). Changed back to port 3306.
Restarting system and xampp multiple times - no success.
Following steps I did which made it run again.
Made a backup/copy of data folder as data_v2
Created a blank data folder
Copied all files from mysql/backup folder to empty mysql/data folder (this step I did to check if the issue is with databases or files that were present in mysql/data folder before backup)
Checked phpmyadmin - it is now working
Copied required database folders from data_v2 folder to data folder
Checked phpmyadmin - it failed
Checked my.ini file present in mysql/data folder (not the one present in bin folder). Path here was wrong. It was default of c:/ (c drive), my xampp is in e:/ (e drive). Updated this path in my.ini.
Checked phpmyadmin - it is now working
I tried opening 1 of the databases in phpmyadmin. Then clicked on 1 of the tables. Issue - doesn't exist in engine
Copied file ibdata1 from data_v2 folder to data folder
Repeated Step 9. I tried opening 1 of the databases in phpmyadmin. Then clicked on 1 of the tables. It worked fine.
Tried opening a site on localhost. Issue - access denied for user
Created user in phpmyadmin. Repeated step 12. It worked.

Related

Error: MySQL shutdown unexpectedly. Xampp

XAMPP 3.3.0
MySql port: 3306
I checked any conflict with this port and found nothing
MySql doesn't respond to any request, infinite loading and after that it shuts down leaving no error logs
XAMPP logs:
21:05:56 [mysql] Error: MySQL shutdown unexpectedly.
21:05:56 [mysql] This may be due to a blocked port, missing dependencies,
21:05:56 [mysql] improper privileges, a crash, or a shutdown by another method.
21:05:56 [mysql] Press the Logs button to view error logs and check
21:05:56 [mysql] the Windows Event Viewer for more clues
21:05:56 [mysql] If you need more help, copy and post this
21:05:56 [mysql] entire log window on the forums
MySql server logs:
2022-06-18 21:07:34 0 [Note] InnoDB: Mutexes and rw_locks use
Windows interlocked functions
2022-06-18 21:07:34 0 [Note] InnoDB: Uses event mutexes
2022-06-18 21:07:34 0 [Note] InnoDB: Compressed tables use zlib
1.2.11
2022-06-18 21:07:34 0 [Note] InnoDB: Number of pools: 1
2022-06-18 21:07:34 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-06-18 21:07:34 0 [Note] InnoDB: Initializing buffer pool, total
size = 16M, instances = 1, chunk size = 16M
2022-06-18 21:07:34 0 [Note] InnoDB: Completed initialization of
buffer pool
2022-06-18 21:07:34 0 [Note] InnoDB: 128 out of 128 rollback
segments are active.
2022-06-18 21:07:34 0 [Note] InnoDB: Creating shared tablespace for
temporary tables
2022-06-18 21:07:34 0 [Note] InnoDB: Setting file
'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the
file full; Please wait ...
2022-06-18 21:07:34 0 [Note] InnoDB: File
'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2022-06-18 21:07:34 0 [Note] InnoDB: Waiting for purge to start
2022-06-18 21:07:35 0 [Note] InnoDB: 10.4.24 started; log sequence
number 3046387; transaction id 1396
2022-06-18 21:07:35 0 [Note] InnoDB: Loading buffer pool(s) from
C:\xampp\mysql\data\ib_buffer_pool
2022-06-18 21:07:35 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-06-18 21:07:35 0 [Note] Server socket created on IP: '::'.
Hello!
Just do these simple steps:
Rename the folder C:\xampp\mysql\data to C:\xampp\mysql\data_old
(or any name)
Create new folder C:\xampp\mysql\data
Copy the content that is inside C:\xampp\mysql\backup to
C:\xampp\mysql\data folder
Copy all your database folders that are in C:\xampp\mysql\data_old to
C:\xampp\mysql\data (skip performance_schema, mysql and
phpmyadmin folders from C:\xampp\mysql\data_old)
Finally copy the ibdata1 file from C:\xampp\mysql\data_old and
replace it inside C:\xampp\mysql\data folder
Now Restart MySQL from XAMPP control panel.
And I am sure its all done...
I had the same problem today and i fixed it by deleting all master-xx.info files and the multi-master.info file in C:\xampp\mysql\data
After I started it again it made a new and empty multi-master.info file and it worked perfectly fine again. No Data was lost

XAMPP MySQL won't start after rebooting

This happened without any forewarning, the last thing I registered in the database was a column with the autoincrement property.
This is the error log:
2022-01-27 17:38:28 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-01-27 17:38:28 0 [Note] InnoDB: Uses event mutexes
2022-01-27 17:38:28 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-01-27 17:38:28 0 [Note] InnoDB: Number of pools: 1
2022-01-27 17:38:28 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-01-27 17:38:28 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-01-27 17:38:28 0 [Note] InnoDB: Completed initialization of buffer pool
2022-01-27 17:38:28 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-01-27 17:38:28 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-01-27 17:38:28 0 [Note] InnoDB: Setting file '\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-01-27 17:38:28 0 [Note] InnoDB: File '\xampp\mysql\data\ibtmp1' size is now 12 MB.
2022-01-27 17:38:28 0 [Note] InnoDB: Waiting for purge to start
2022-01-27 17:38:28 0 [Note] InnoDB: 10.4.22 started; log sequence number 809938; transaction id 1388
2022-01-27 17:38:28 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2022-01-27 17:38:28 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-01-27 17:38:28 0 [Note] Server socket created on IP: '::'.
I get this error in XAMPP:
5:42:49 PM [mysql] Error: MySQL shutdown unexpectedly.
5:42:49 PM [mysql] This may be due to a blocked port, missing dependencies,
5:42:49 PM [mysql] improper privileges, a crash, or a shutdown by another method.
5:42:49 PM [mysql] Press the Logs button to view error logs and check
5:42:49 PM [mysql] the Windows Event Viewer for more clues
5:42:49 PM [mysql] If you need more help, copy and post this
5:42:49 PM [mysql] entire log window on the forums
The database would open for days after without me doing any other modifications to it, then suddenly this error happened today.
I fixed it by copying the multi-master.info from the backup folder, although I'd still like to know why this happened in the first place if anyone has any ideas.
The multi.master.info is empty.
Rename the folder mysql/data to mysql/data_old (you can use any name)
Create a new folder mysql/data
Copy the content that resides in mysql/backup to the new mysql/data folder
Copy all your database folders that are in mysql/data_old to mysql/data
Finally copy the ibdata1 file from mysql/data_old and replace it inside mysql/data folder
Start MySQL from XAMPP control panel

Error: MySQL shutdown unexpectedly in XAMPP SERVER

I was working on xampp server. I have done my work yesterday and open my system today. Now, when I start MySQL from Xampp control panel then receive errors
Error: MySQL shutdown unexpectedly.
5:49:38 PM [mysql] This may be due to a blocked port, missing dependencies,
5:49:38 PM [mysql] improper privileges, a crash, or a shutdown by another method.
5:49:38 PM [mysql] Press the Logs button to view error logs and check
5:49:38 PM [mysql] the Windows Event Viewer for more clues
5:49:38 PM [mysql] If you need more help, copy and post this
5:49:38 PM [mysql] entire log window on the forums
MYSQL log file - MYSQL errors
2021-08-23 17:49:35 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-08-23 17:49:35 0 [Note] InnoDB: Uses event mutexes
2021-08-23 17:49:35 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-23 17:49:35 0 [Note] InnoDB: Number of pools: 1
2021-08-23 17:49:35 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-08-23 17:49:35 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-08-23 17:49:35 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-23 17:49:36 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-08-23 17:49:36 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-08-23 17:49:36 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-08-23 17:49:36 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-08-23 17:49:36 0 [Note] InnoDB: Waiting for purge to start
2021-08-23 17:49:36 0 [Note] InnoDB: 10.4.13 started; log sequence number 47242; transaction id 9
2021-08-23 17:49:36 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2021-08-23 17:49:36 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-08-23 17:49:36 0 [Note] InnoDB: Buffer pool(s) load completed at 210823 17:49:36
2021-08-23 17:49:36 0 [Note] Server socket created on IP: '::'.
It was working cool yesterday. I didn't do anything yesterday.
I tried solution -
XAMPP - MySQL shutdown unexpectedly
After tried the solution, It's working but many tables do not exist in the engine.
Like - Table 'database.meditemimg' doesn't exist in engine
I have 10 tables in my database. Three tables exist but 7 tables do not exist after applied this method -
Rename the folder mysql/data to mysql/data_old (you can use any name)
Create a new folder mysql/data
Copy the content that resides in mysql/backup to the new mysql/data folder
Copy all your database folders that are in mysql/data_old to mysql/data (skipping the mysql, performance_schema, and phpmyadmin folders from data_old)
Finally copy the ibdata1 file from mysql/data_old and replace it inside mysql/data folder
Start MySQL from XAMPP control panel
The collation changed to in use for 7 tables.
Is there another way to fix MySQL shutdown error ?
Extend buffer size related values on my.ini from mysql/bin
Answer is here -
https://stackoverflow.com/a/72721411/3178959

MySQL shutdown unexpectedly in XAMPP while apache working

This message is in my XAMPP control panel when I click the start button.
This warning is showing that MySQL shutdown unexpectedly, but the Apache Server is running fine.
11:29:21 AM [main] Starting Check-Timer
11:29:21 AM [main] Control Panel Ready
11:29:28 AM [main] Executing "c:\xampp\mysql"
11:29:50 AM [mysql] Attempting to start MySQL app...
11:29:51 AM [mysql] Status change detected: running
11:30:00 AM [mysql] Status change detected: stopped
11:30:00 AM [mysql] Error: MySQL shutdown unexpectedly.
11:30:00 AM [mysql] This may be due to a blocked port, missing dependencies,
11:30:00 AM [mysql] improper privileges, a crash, or a shutdown by another method.
11:30:00 AM [mysql] Press the Logs button to view error logs and check
11:30:00 AM [mysql] the Windows Event Viewer for more clues
11:30:00 AM [mysql] If you need more help, copy and post this
11:30:00 AM [mysql] entire log window on the forums
This is MySQL error log:
2020-05-05 11:29:51 0 [Note] InnoDB: using atomic writes.
2020-05-05 11:29:51 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-05-05 11:29:51 0 [Note] InnoDB: Uses event mutexes
2020-05-05 11:29:51 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-05-05 11:29:51 0 [Note] InnoDB: Number of pools: 1
2020-05-05 11:29:51 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-05-05 11:29:51 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-05-05 11:29:51 0 [Note] InnoDB: Completed initialization of buffer pool
2020-05-05 11:29:51 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-05-05 11:29:51 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-05 11:29:51 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-05 11:29:51 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2020-05-05 11:29:51 0 [Note] InnoDB: Waiting for purge to start
2020-05-05 11:29:51 0 [Note] InnoDB: 10.4.8 started; log sequence number 113908; transaction id 9
2020-05-05 11:29:51 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2020-05-05 11:29:51 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-05 11:29:51 0 [Note] InnoDB: Buffer pool(s) load completed at 200505 11:29:51
2020-05-05 11:29:51 0 [Note] Server socket created on IP: '::'.
I tried most of the things I found on StackOverflow, but it didn't work.
Can anyone help me to find a solution?
I found this helpful after searching for nearly an hour online.
You can go through the solution screenshotted here or browse the XAMPP forum here
This method solved solved my issues
Step 1. Rename the folder c:\xampp\mysql\data to c:\xampp\mysql\data_old (you can use any name).
Step 2. Create a new folder c:\xampp\mysql/data.
Step 3. Copy the content that resides in mysql\backup to the new mysql\data folder.
Step 4. Copy all your database folders that are in mysql\data_old to mysql\data (skipping the mysql, performance_schema, and phpmyadmin folders from data_old).
Step 5. Finally copy the ibdata1 file from mysql\data_old and replace it inside mysql\data folder.
Step 6. Start MySQL from XAMPP control panel.
And, Its DONE . No databases lost, no ports changed, no run as administrator, no force recovery, no kill mysqld process, no restoring from previous versions, no more errors.
For more information check this blog post
Main issue that I faced is, some of my database size is to high.
But ibdata1 can not be auto extended.
So I did those step and my error was fixed.
Go to mysql/data folder
remove aria_log.00000001, aria_log_control, ib_logfile0, ib_logfile1, ibdata1, mysql.pid
Go to the my.ini from mysql/bin
Here you will find some buffer size related key values like->
key_buffer, max_allowed_packet, sort_buffer_size, net_buffer_length, read_buffer_size, read_rnd_buffer_size, myisam_sort_buffer_size, innodb_data_file_path, innodb_buffer_pool_size, innodb_log_file_size, innodb_log_buffer_size, innodb_lock_wait_timeout, max_allowed_packet
restart apache and mysql
check if it is solved or not.
100% worked for me.

MySql startup error ' ERROR! The server quit without updating PID file'

I have tried every link that is on S.O but still getting the same outcome every time I try to start MySQL. Following is the log from the .err file.
2018-01-07T06:58:11.729500Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2018-01-07T06:58:11.731659Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-01-07T06:58:11.731673Z 0 [Note] InnoDB: Uses event mutexes
2018-01-07T06:58:11.731679Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-01-07T06:58:11.731682Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-01-07T06:58:11.731969Z 0 [Note] InnoDB: Number of pools: 1
2018-01-07T06:58:11.732068Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-01-07T06:58:11.733672Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-01-07T06:58:11.745339Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-01-07T06:58:11.761905Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-01-07T06:58:11.906535Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-01-07T06:58:11.906692Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-01-07T06:58:11.918639Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-01-07T06:58:11.919925Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-01-07T06:58:11.919938Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-01-07T06:58:11.920116Z 0 [Note] InnoDB: Waiting for purge to start
2018-01-07T06:58:11.974340Z 0 [Note] InnoDB: 5.7.20 started; log sequence number 129183358
2018-01-07T06:58:11.974571Z 0 [Note] InnoDB: Loading buffer pool(s) from /usr/local/var/mysql/ib_buffer_pool
2018-01-07T06:58:11.974744Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-01-07T06:58:11.974853Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180107 12:28:11
2018-01-07T06:58:11.983233Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2018-01-07T06:58:11.983254Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2018-01-07T06:58:11.983981Z 0 [Warning] CA certificate ca.pem is self signed.
2018-01-07T06:58:11.984032Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2018-01-07T06:58:11.989041Z 0 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2018-01-07T06:58:11.989070Z 0 [Note] - '127.0.0.1' resolves to '127.0.0.1';
2018-01-07T06:58:11.989136Z 0 [Note] Server socket created on IP: '127.0.0.1'.
2018-01-07T06:58:11.989166Z 0 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
2018-01-07T06:58:11.989169Z 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2018-01-07T06:58:11.989199Z 0 [ERROR] Aborting
It looks like you have some other software that is using the port 3306. MySQL uses this port, but it's failing to bind to it because it is in use. End the other software and try to launch MySQL again.
If you need to have the other software running at the same time with MySQL, you have to change the default port in one of them to some other unused port.
To change the port in MySQL. If you're on Windows, find the my.ini file for MySQL installation, open this file in a text editor and look for this section:
# The TCP/IP Port the MySQL Server will listen on
port=3306
Then change the number of the port, save the file, and restart the MySQL service.