Error: MySQL shutdown unexpectedly XAMPP [closed] - mysql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
[mysql] Error: MySQL shutdown unexpectedly.
[mysql] This may be due to a blocked port, missing dependencies,
[mysql] improper privileges, a crash, or a shutdown by another method.
[mysql] Press the Logs button to view error logs and check
[mysql] the Windows Event Viewer for more clues
[mysql] If you need more help, copy and post this
[mysql] entire log window on the forums
I have Used recommended solution XAMPP - MySQL shutdown unexpectedly
But result showing same.
Can Anyone help?
Thanks In Advance
S K Setia

i did the following
C:\xampp\mysql\data -> multi-master.info
remove content from file and restart mysql

xampp->mysql->data
cut all files from data folder
and paste to another folder
now restart mysql
paste all folders from your folder to myslq->data folder
and also paste ib_logfile0.ib_logfile1 , ibdata1 into data folder from your folder.
your database and your data is now available in phpmyadmin..

Man, if you have MySQL server install and running, stop it. The error occured because of conflicting MariaDB and the other server.

Solution:
Check MySQL Error Log
Start MySQL on XAMPP Control panel.
Check the My SQL Error log “mysql_error.log” by clicking on the Logs button on XAMPP control panel.
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.
Now, 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.
MySQL error This may be due to a blocked port, missing dependencies,
improper privileges, a crash, or a shutdown by another method.
Start MySQL from XAMPP
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.

I tried to fix this issue with the all methods in
here.
But they didn't fix my issue.
In my case, I solved with this way ~
Firstly: In the XAMPP control panel, press the 'Config' button and after that press 'my.ini'.
Secondly: In this "my.ini" file, find the drive-path.
Change Drive path
I installed xampp on "C:\xamp" , but in the "my.ini" file all the paths were started
with "E:\xamp..." So I replaced "E:\xampp" with "C:\xamp".
Because I had installed xampp on "E:\xamp" long time ago.
Thirdly . And then restart the xampp.
"WoW~" it was fixed!!!

Related

How to get MySql data from files without phpMyAdmin

My MySql was not working for 2 hours in xampp.
My logs are
01:37:11 [mysql] Error: MySQL shutdown unexpectedly.
01:37:11 [mysql] This may be due to a blocked port, missing dependencies,
01:37:11 [mysql] improper privileges, a crash, or a shutdown by another method.
01:37:11 [mysql] Press the Logs button to view error logs and check
01:37:11 [mysql] the Windows Event Viewer for more clues
01:37:11 [mysql] If you need more help, copy and post this
01:37:11 [mysql] entire log window on the forums
I have tried almost everything and nothing is working for me and I think I have also made my xampp settings even worse.
So now I will delete xampp and install again.
But wait, my databases are very important.
So is there by which I reinstall xampp and also I have all the databases I need.
I can't start MySql
I can't access phpMyAdmin
So how can I save my data from files?
Good luck trying "open your SQL files" (whatever those are).
The answers as to why MySQL is not running are in your log files.
Yes, you can back up the data files and restore them into a new installation.
We can't tell you where those files are - it depends on how you installed MySQL. This might be defined in C:\Windows\my.ini (you're looking for files named .ibd and .frm).
Make sure the MySQL service is stopped. Move the directory containing these file out of the way, then remove and reinstall MySQL. After that stop the (newly installed MySQL service) edit C:\Windows\my.ini to set the datadir to the ,oved files, and start mysql.
You should open your sql files and look at the data, if it looks fine you can copy your backup folder into a recovery disk like F and reinstall it than copy the backup into your new data and replace new data with your backup you just copied, if the data is corrupt, well you need to go and try: https://dev.mysql.com/doc/mysql-backup-excerpt/5.7/en/myisam-table-maintenance.html But the thing is if it does not work than most likely you need to force INNODB reboots......

MySQL Workbench Unable to Retrieve Disk Space in Data Dir, Server Stopped

I had mySQL workbench working fine a few weeks ago. Now, any time I log in, I get no connection. Upon inspecting Sever Status, it is showing Stopped. Also, under the Server Directories, it says Unable to Retrieve next to Disk Space in Data Dir.
I also noticed that the configuration file was wrong, or outdated? The Configuration File originally read:
C:\ProgramData\MySQL\MySQL Server 5.5\my.ini
But I looked and there was no MySQL Server 5.5 file in my directory. I do have a MySQL Server 8.0 folder, so I changed the Configuration File to:
C:\ProgramData\MySQL\MySQL Server 8.0\my.ini
However, this fails to solve the problem. I've also attempted to run Services from the Start Menu, right click on MYSQL80, and choose start - and it says the service has Started then stopped.
I'm not even sure this missing or mis-directed file is the issue, or whether it's the Unable to Retrieve Disk error (or both are causing the server to fail). I recently changed my login password for my computer - but I doubt that is related to the login credentials for MySQL, right? (I see MYSQL80 properties has password for 'log on' option, but I have no idea what this password even is, or how to change it).
I've also read about this problem online and cannot seem to find an answer that solves the issue. I've tried running MySQL Workbench as an admin too, and that doesn't work either.
Can anyone point me in the right direction? Is there a way to get the server up and running again without a bunch of complicated command line? I appear to have mysqld.exe in the bin file in MySQL 8.0
Thanks all in advance!
In MySql Workbench Server -> Startup/ShutDown -> Start Server.
This Worked for me.
When the my.ini file is messed up I think the best solution is a total uninstall/delete and manual install. Before you do any of the following make sure you go to your current data dir and save your database folders. Then dlete all of your current MySQL related directories and uninstall MySQL and MySQL workbench.
I had this problem when I installed MySQL 8.0.15 with the community installer. The my.ini file that came with the installer did not work correctly after it had been edited. I did a full manual install by downloading that zip folder. I was able to create my own my.ini file containing only the parameters that I was concerned about and it worked.
download zip file from MySQL website
unpack the folder into C:\program files\MySQL\MySQL8.0
within the MySQL8.0 folder that you unpacked the zip folder into, create a text file and save it as my.ini
include the parameters in that my.ini file that you are concerned about. so something like this(just ensure that there is already a folder created for the datadir or else initialization won't work):
[mysqld]
basedire=C:\program files\MySQL\MySQL8.0
datadir=D:\MySQL\Data
....continue with whatever parameters you want to include
initialize the data directory by running these two commands in the command prompt:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --default-file=C:\program files\MySQL\MySQL8.0\my.ini --initialize
install the MySQL server as a service by running these two commands:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --install --default-file=C:\program files\MySQL\MySQL8.0\my.ini
finally, start the server for the first time by running these two commands:
cd C:\program files\MySQL\MySQL8.0\bin
mysqld --console

Error dropping database (can't rmdir '.\abm', errno: 41) on windows in mysql server

I have a database that I would like to drop from the server but when I wanna drop it I am getting the above error.
Trying to look for the solution I found some answer the problem at this link Error in dropping a database in MySQL (can't rmdir '.\oro', errno: 41) but what I don't see the folder they are talking about. I went in the C:\Program Files\MySQL\MySQL Server 5.5\data folder but I coudn't see a folder with the name of my database not even when I did searching in the folder C:\Program Files\MySQL\MySQL Server 5.5\
Windows Error 41 is "directory not empty." https://msdn.microsoft.com/en-us/library/t3ayayh1.aspx
Proceed cautiously. You don't want MySQL's internal structures to become inconsistent with what's on the disk.
Run the query SELECT ##DATADIR; to find the directory that should contain a folder for each of your databases, including one called abm.
Contrary to the advice offered in the other question, don't delete the abm folder once you find it. Instead, leave the folder there, and move the files inside it somewhere outside the datadir where MySQL can't see them.
Then try again to drop the database the normal way.
Finally, restart MySQL to be absolutely sure that its internal structures are consistent with the disk files, by reviewing the log for errors. If the server restarts with no errors, and the database is no longer listed, it should be safe to delete the stray files you copied out of harm's way, above.
If you are windows user. Go to your XAMPP directory -> Mysql directory -> data -> then you will be seeing your list of databases inside this folders. Just cut and paste the database outside somewhere in desktop which you want to remove. If you are using phpmyadmin refresh the page. If you are not finding any errors. you are good to go.
I was getting same error, and did two things
I just provided full access rights to current user.
Open Database folder and than execute your sql (drop database mydatabase).
If above solution not works for you, than you have to delete database folder manually.

XAMPP NOT WORKING! - OS X Yosemite

I was working with XAMPP 1.8.3-3 on OS X Mavericks. After upgrading to Yosemite Mysql server stopped working. And an upgrade to XAMPP 1.8.3-5 fixed the problem and mysql server starts working.
Now the entire database list is showing on phpmyadmin, but no access to the tables. Its showing “#1146 - Table ‘DB_NAME.TABLE_NAME’ doesn’t exist”.
Unfortunately I don't have any DB backup!
I have the entire XAMPP folder backup. So how I can able to retrieve the mysql tables?
just type /Applications/XAMPP/xamppfiles/bin/mysql.server start
in terminal then start xampp
you can restore if you have all the mysql folders from XAMPP folder. (check /XAMPP/xamppfiles/var/mysql in backup)
if you have var/mysql folder, open and look for database names you had earlier.
there is a separate folder for each database you had earlier. open the folder and it will contain lots of files with table names.
if your old table engine is InnoDB you will see 2 files. with .frm and .ibd extensions.
or if you had MyISM it will contain three file per table which has .frm, .MYD and .MYI extensions.
after you verify you have all the required files in backup, you can start restoring them.
stop mysql
copy required database folder completely and paste it to currently installed folder. (/Applications/XAMPP/xamppfiles/var/mysql/)
start mysql
to restore web files, open htdocs folder in backup and copy required site folder to currentely xampp installed htdocs folder.
This solution worked for me. Good Luck !
Do a clean install. See my answer for my own question. xampp mysql server not starting. The bad part is that I'm not sure if it will save your database the way I explained. What you might try is going to xampp > xamppfiles > var > mysql > 'your database name' and making a copy of the database folder on your desktop and moving it back once you reinstall it. I tried and I think it might have worked had I changed the file permissions. You can also try experimenting to see if it preserves the database if you do this. I would do some serious testing if you really want to save your database before doing this.

How do I move a MySQL database from one hard drive to another?

I am using MySQL 5.5 and MySQLWorkbench on Windows7. I have successfully created a database on my C: drive but I want to move it to my E: drive. I stopped the mysqld daemon and edited the my.ini file to change datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/" to datadir="E:/MySQL/data/". I copied the data from the C: location to the E: location.
I can start the mysqld process, but the database I created does not appear. Would anyone have any explanation as to what I am doing wrong?
Basicly you would like to copy all the contents in the old directory to the new directory. Make sure that while doing this you don't also copy binlogs (if any, they look like mysql-bin.001 etc. and also don't copy mysql-bin.index because that contains real path reference to the old binary logs). Once you do that, you should be able to restart the mysql daemon and login to see the databases.
PS: not tested, but should work.
When I was trying to move my database I ran into the issue where windows didn't have the same permissions on the new data folder as the original. You may check that the correct user(s) have access to the new folder by going to the properties of the folder then selecting the security tab.
As I wanted my innodb database to sit on another partition, I stopped MySQL from the MySQL Workbench. I copied my innodb database ibdata1 as well as 2 log files which MySQL automatically created in my C:\ProgramData\MySQL\ folder to a new folder on my E: partition. I added the following to my.ini:
innodb_data_home_dir = "E:/MySQL Data"
Now, when I start my database, all changes are made to the ibdata1 in the E: drive.
Dump your database to disk using this tool http://sourceforge.net/projects/mysqlbutool/ Then restore it to the new server using this tool http://www.webyog.com/