XAMPP - MySQL shutdown unexpectedly

前端 未结 30 1711
长情又很酷
长情又很酷 2020-11-22 09:42

When I open XAMPP and click start MySQL button and it gives me an error. I had started it just before, but now it isn\'t working.

12:19:12 PM [mysql]

相关标签:
30条回答
  • 2020-11-22 10:23

    What worked for me is:

    1. First I open Logs for MySql in XAMPP panel.
    2. At the end it says you are running another instance of mysqlid in port 3306
    3. I opened my task manager(Ctrl+Shift+Esc) then find mysqlid and End the task.
    0 讨论(0)
  • 2020-11-22 10:26

    I got the same kind of error in my C:\xampp\mysql\data\mysql_error.log when trying to start mysql.

    2013-08-05 01:20:32 6780 [ERROR] InnoDB: Attempted to open a previously 
      opened tablespace. Previous tablespace mysql/slave_relay_log_info uses 
      space ID: 3 at filepath: .\mysql\slave_relay_log_info.ibd. Cannot open  
      tablespace test_database/test_table which uses space ID: 3 at filepath:  
      .\test_database\test_table.ibd
    

    You'll have to read the error closely. This says that test_database is preventing mysql from starting.

    You could blow away the offending database, these steps fix the problem:

    1. Make sure mysql and xampp is shut down completely.
    2. Go to your directory where mysql is installed, mine is: C:\xampp\mysql\data
    3. You should see a folder with the name of a database that you created. mine was test_database.
    4. Create a new folder somewhere else called C:\xampp\mysql\data\mysql\backuptablespace
    5. Drag and drop (don't delete) the offending database table folder to the backup directory.
    6. Try to start mysql again. For me it started right up in 1 second as expected.

    If it doesn't work, put the file back where you started and you'll be back where you started.

    If you don't want to delete the database and don't have backups:

    If you don't have backups of table data and mysql won't start because something is corrupted you'll have to use the process of elimination to guess-and-check your way to exactly what you did that corrupted it. Follow these steps:

    1. Make a clone of the entire C:\xampp\ and store it somewhere safe so you can get back to where you started.
    2. Use a "binary search" approach to try to locate the corrupted item in the mysql database. It could be a file, or a table, or a database, or a user or anything.
    3. Delete the entire database and see if that allows mysql to start. If it does, then put back the database and try removing some of the tables. If it doesn't, then try yanking out something else until it does start.
    4. Try removing these files from C:\xampp\mysql\data\mysql: db.frm db.MRD db.MYI db.opt user.frm user.MYD user.MYI

    5. When you get mysql to start, try putting things back until you find the one thing that you add which prevents it from starting. One bonus for this is you learn how mysql works under the hood.

    Nuclear option:

    Something you did screwed up the mysql server. An uninstall and reinstall of XAMPP should undo the corruption.

    0 讨论(0)
  • 2020-11-22 10:26

    Go to task manager And search mysqld and right click and select END TASK and refresh XAMPP

    0 讨论(0)
  • 2020-11-22 10:27

    i comment this statement in mysql/bin/my.ini

    'innodb_additional_mem_pool_size=2M'
    

    and it solve my problem. than you everyOne

    0 讨论(0)
  • 2020-11-22 10:27

    I solved similar MySQL error & I think this answer will help you to fix the same type of MySQL database error.

    Solution:

    • Go to the “data” directory in the mysql database.
    • I installed XAMPP on D: drive on my computer & the mysql “data” directory location of my computer was “D:\xampp\mysql\data\”. You may have different location.

    Take Backup of MySQL “data” Folder

    • First of all you should create a backup of the “data” folder using any compression software.

    • Give a name like “data_backup.zip” or any type of compression you wish.

    • I used winrar compression software to compress & backup mysql “data” folder.

    Rename the “data” folder

    • Rename the “data” folder to “data-oldfiles”. This is very important to rename the data directory to any new directory name.

    Create a new “data” folder

    • Create a new folder and give the folder name as “data“
    • To solve the problem we need to create a new “data” directory in the mysql database.

    Copy content from “backup” folder

    • Go to the “backup” folder and copy all files.
    • Paste the files from backup folder to data folder
    • Now start the MySQL database from XAMPP.
    • Your MySQL database will start properly without showing any error.

    Transfer all MySQL projects Database, Data file & Log files

    • If you have many database which was used for various projects, then you have to transfer all database from “data-oldfiles” folder to “data” folder.

    • Copy all databases from the data-old files and paste to the data folder.

    • Now you have to copy the data file “ibdata1” & all log files “ib_logfile0, ib_logfile1 ” from data-old files folder to the data folder.

    • If you have many id_logiles then copied all of them.

    • Now Start MySQL from XAMPP.

    • Go to phpMyAdmin to check all databases are available & working.

    • Now start your any website project from localhost to check the MySQL database.

    The Problem is solved !!

    • Now you will see the problem is solved and the error message “Error: MySQL shutdown unexpectedly.” will not show again.
    • If you have any question on this issue please feel free to ask any question in the comments section.

    You can read the details tutorials on the link bellow: Error: MySQL shutdown unexpectedly – Solution in 5 easy steps

    You can also watch video tutorials to solve the problem:

    [Solved] Error: MySQL shutdown unexpectedly

    0 讨论(0)
  • 2020-11-22 10:29

    Here is what I did. I restarted my computer. Next I run services.msc. I stopped the MySQL service then restarted it. The restarted the Xampp server.

    0 讨论(0)
提交回复
热议问题