32

When I try to start XAMPP - MySql it doesn't work. I've already tried to fix it, but I couldn't find any actual solution, I hope you can find what's wrong with it.

There's the log:

2019-06-26  9:08:35 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-06-26  9:08:35 0 [Note] InnoDB: Uses event mutexes
2019-06-26  9:08:35 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-06-26  9:08:35 0 [Note] InnoDB: Number of pools: 1
2019-06-26  9:08:35 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-06-26  9:08:35 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2019-06-26  9:08:35 0 [Note] InnoDB: Completed initialization of buffer pool
2019-06-26  9:08:35 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibdata1' size to 10 MB. Physically writing the file full; Please wait ...
2019-06-26  9:08:35 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibdata1' size is now 10 MB.
2019-06-26  9:08:35 0 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile101 size to 5242880 bytes
2019-06-26  9:08:35 0 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile1 size to 5242880 bytes
2019-06-26  9:08:36 0 [Note] InnoDB: Renaming log file C:\xampp\mysql\data\ib_logfile101 to C:\xampp\mysql\data\ib_logfile0
2019-06-26  9:08:36 0 [Note] InnoDB: New log files created, LSN=45786
2019-06-26  9:08:36 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2019-06-26  9:08:36 0 [Note] InnoDB: Doublewrite buffer created
2019-06-26  9:08:36 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-06-26  9:08:36 0 [Note] InnoDB: Creating foreign key constraint system tables.
2019-06-26  9:08:36 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2019-06-26  9:08:36 0 [Note] InnoDB: Creating sys_virtual system tables.
2019-06-26  9:08:36 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2019-06-26  9:08:36 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-06-26  9:08:36 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-06-26  9:08:36 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2019-06-26  9:08:36 0 [Note] InnoDB: Waiting for purge to start
2019-06-26  9:08:36 0 [Note] InnoDB: 10.3.16 started; log sequence number 0; transaction id 7
2019-06-26  9:08:36 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-06-26  9:08:36 0 [Note] Server socket created on IP: '::'.
2019-06-26  9:08:36 0 [ERROR] mysqld.exe: Table '.\mysql\user' is marked as crashed and should be repaired
2019-06-26  9:08:36 0 [ERROR] mysqld.exe: Index for table '.\mysql\user' is corrupt; try to repair it
2019-06-26  9:08:36 0 [ERROR] Couldn't repair table: mysql.user
2019-06-26  9:08:36 0 [ERROR] Fatal error: Can't open and lock privilege tables: Index for table 'user' is corrupt; try to repair it
Shark44
  • 593
  • 1
  • 4
  • 11
  • See [ApacheFriends.org](https://community.apachefriends.org/f/viewtopic.php?f=16&t=78295) for bug description – Bad Loser Jul 26 '19 at 08:18

9 Answers9

146

This is as a result of some files in C:\xampp\mysql\data\mysql getting corrupted.

Solution:

  1. Back up C:\xampp\mysql\data
  2. Copy all file C:\xampp\mysql\backup
  3. Paste and replace existing file in: C:\xampp\mysql\data, except for the ibdata1 file.
    Leaving ibdata1 will help against table does not exist error.
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
Tobiloba
  • 1,618
  • 1
  • 11
  • 7
41

The solution was just a

Copy From ...xampp/mysql/backup/... of all files and paste into .../xampp/mysql/data/  -> you will lost your data

Just copy the folder From ...xampp/mysql/backup/ & Paste into .../xampp/mysql/data/  -> this will help to run Mysql & existing database is working
Kailas
  • 3,173
  • 5
  • 42
  • 52
nourhero
  • 568
  • 5
  • 12
12

copy all the file and folder from xampp/mysql/backup/ and paste it to xampp/mysql/data/. If asked for replace than click on replace all

Prafful Panwar
  • 439
  • 7
  • 19
9

That happened to me before and the solution was very simple for that. please Read all steps carefully :

  1. Make a backup for this folder C:\xampp\mysql\data (make sure your backup folder's name is not backup) .
  2. Now Copy all files/folders from C:\xampp\mysql\backup except ibdata1 to avoid error of table does not exist .
  3. Paste all copied files/folders to C:\xampp\mysql\data

Hope your problem will be sloved.

Oussama Madjmaa
  • 101
  • 1
  • 4
4

@tobiloba's Solution is a temporary one. I had the similar problem. and which will be solved temporarily with his solution. But on next time of mysql start. it failed. As I need to keep my data as well as open the mysql server to run it.

Open your my.conf from xampp/mysql/bin/my.conf and find this two lines.

innodb_buffer_pool_size=10M

change this to 30M 0r 50MB. and than

 innodb_data_file_path=ibdata1:20M:autoextend

change this too

 innodb_data_file_path=ibdata1:60M:autoextend

For me it solved the problem permanently and keep my existing data alive and works fine after that.

Kvvaradha
  • 732
  • 1
  • 13
  • 28
  • 2
    in my case, the file location is bin/my.ini, just in case you don't find the my.conf file. – Kosmas Nov 08 '22 at 04:45
1

Simply edit this line from my.ini:

; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit=128M -> choose size you want.

Nghia
  • 11
  • 1
1

For me, I did a backup of the data folder, then copied the files and folders in /backup/ to /data/ and the service started successfully. I did not have to copy anything from my backed up data except for ibdata1 without which complained about tables not existing.

1

This solution will help to secure your existing database.

Just copy the folder From ...xampp/mysql/backup/ & Paste into .../xampp/mysql/data/  -> this will help to run Mysql & existing database is working
Akash Sethi
  • 184
  • 1
  • 4
  • 15
0

Delete or Move the ib_logfile0 and ib_logfile1 to a backup folder.. and try to restart Mysql That will restore those files and mysql should run without loosing any data.

Musikdoktor
  • 144
  • 2
  • 13