Mysql will not restart - mysql

I'm trying to start the mysql server using the command
sudo /etc/init.d/mysql start
but it won't start. I don't get a specific error all I see is
* Starting MySQL database server mysqld [fail]
i've tried the same command but using restart instead but same results. I've also tried to start it using
sudo service start mysql
I am stuck at this point. please let me know if I can provide anymore information.
Thank you.
Here is my mysql error.log
150505 21:43:49 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
150505 21:43:49 [Note] Plugin 'FEDERATED' is disabled.
150505 21:43:49 InnoDB: The InnoDB memory heap is disabled
150505 21:43:49 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150505 21:43:49 InnoDB: Compressed tables use zlib 1.2.8
150505 21:43:49 InnoDB: Using Linux native AIO
150505 21:43:49 InnoDB: Initializing buffer pool, size = 128.0M
150505 21:43:49 InnoDB: Completed initialization of buffer pool
150505 21:43:49 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 30152041
150505 21:43:49 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 30161741

I know this question was posted long back. But I have figured out a solution since I had the same problem. This error might occurs due to multiple installations of MySQL, in the operating system.
sudo ps -A|grep mysql
Kill the process of mysql
sudo pkill mysql
Then run the command
sudo ps -A|grep mysqld
kill process of mysqld
sudo pkill mysqld
Now you can safely restart MySQL server
sudo service mysql restart
mysql -u root -p
Hope this helps

sudo /etc/init.d/mysql start this should work.
Or else
restart server using sudo /etc/init.d/mysql restart
Still down.
run service mysql status and check script name(this will be sometimes mysqld).
then
service mysqld status
service mysqld stop
service mysqld start

Related

Unable to start MYSQL service after data directory change

This is going to be a long one. Please read.
I created an new Azure Ubuntu 18.04 with a 1 TB drive. Setup went fine. Then I installed MySql server using this link. Everything went fine. I was able to start up the mysql with no issues.
My next step was to change the data directory path. I followed this guide. The only difference I changed from the guide was the sudo rsync -av /var/lib/mysql /mnt/MYSQLDATA. When I ran that command, it didn't do anything. Nothing copied over. I replace it with cp * -r /mnt/MYSQLDATA to copy everything over.
I followed the guide to the end. I changed the cnf for mysql /etc/mysql/mysql.conf.d/mysqld.cnf to read:
datadir = /mnt/MYSQLDATA
Next, I changed the alias also sudo nano /etc/apparmor.d/tunables/alias:
`# alias /var/lib/mysql/ -> /mnt/MYSQLDATA/`,
I figured I had to change the [/etc/apparmor.d/usr.sbin.mysqld][3] config. This is the code I used:
# Allow data dir access
/mnt/MYSQLDATA/ r,
/mnt/MYSQLDATA** rwk,
Restarted the apparmor. Everything looked like it was set. I even went to make sure that mysql was the owner of the folder path, so I can chown -R mysql:mysql /mnt/MYSQLDATA. Now it was time to restart the service and it doesnt restart. I keep getting
Job for mysql.service failed because the control process exited with an error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
2022-07-18T23:01:30.236755Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-07-18T23:01:30.236994Z 0 [Warning] Can't create test file /mnt/MYSQLDATA/LEGMYSQLR.lower-test
2022-07-18T23:01:30.237046Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.38-0ubuntu0.18.04.1) starting as process 7569 ...
2022-07-18T23:01:30.240273Z 0 [Warning] Can't create test file /mnt/MYSQLDATA/LEGMYSQLR.lower-test
2022-07-18T23:01:30.240311Z 0 [Warning] Can't create test file /mnt/MYSQLDATA/LEGMYSQLR.lower-test
2022-07-18T23:01:30.244072Z 0 [Note] InnoDB: PUNCH HOLE support available
2022-07-18T23:01:30.244101Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2022-07-18T23:01:30.244106Z 0 [Note] InnoDB: Uses event mutexes
2022-07-18T23:01:30.244110Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2022-07-18T23:01:30.244131Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-07-18T23:01:30.244135Z 0 [Note] InnoDB: Using Linux native AIO
2022-07-18T23:01:30.244437Z 0 [Note] InnoDB: Number of pools: 1
2022-07-18T23:01:30.244573Z 0 [Note] InnoDB: Using CPU crc32 instructions
2022-07-18T23:01:30.247391Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2022-07-18T23:01:30.255749Z 0 [Note] InnoDB: Completed initialization of buffer pool
2022-07-18T23:01:30.258357Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-07-18T23:01:30.268405Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2022-07-18T23:01:30.268428Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2022-07-18T23:01:30.268444Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2022-07-18T23:01:30.869299Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2022-07-18T23:01:30.869354Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2022-07-18T23:01:30.869360Z 0 [ERROR] Failed to initialize builtin plugins.
2022-07-18T23:01:30.869364Z 0 [ERROR] Aborting
2022-07-18T23:01:30.869421Z 0 [Note] Binlog end
2022-07-18T23:01:30.869518Z 0 [Note] Shutting down plugin 'CSV'
2022-07-18T23:01:30.869895Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
I have no idea what I did wrong and where it went wrong. In the journalctl -xe it just shows mysql.services: control process exited, code=exited status=1 or mysql.services: start request repeated too quickly. I am pulling my hair out trying to figure out what went wrong. Please help.
I was also running into similar problem.
The main problem was /mnt/mysqldisk/mysql the mysqldisk was created by my user so in the /var/log/syslog it was complaining it could not write to mysql directory.
I changed the permissions to mysql:mysql using shown on the directory. that should solve your problem
The easiest solution I found is using softlink
This is the final solution I did and you don't need to go through any complicated steps
-stop the mysql server
-sudo cp -a /var/lib/mysql /mnt/mysqldisk/mysql
-sudo mv /var/lib/mysql /var/lib/mysql.bak
` #create a soft link that points to the new mount mysql directory
sudo ln -s /mnt/mysqldisk/mysql/ /var/lib/mysql
Start the mysql service and check it comes up.
you do not need to do any change to /etc/mysql/mysql.conf.d/mysqld.cnf or any Alias etc.
This since to the mysql it looks as if mysql is still at the same place and the original config will still be able to access the new location from the soft link.
This is on ubuntu 18.04 LTS

XAMPP: MySQL does not start after crash

There are aready several questions regarding that MySQL fails to start when running XAMPP, but unfortunately I couldn't figure out a solution from these.
Here is my case:
I installed XAMPP for Linux 5.6.14-3 and when I ran it yesterday everything worked fine.
Today, I ran XAMPP again:
/opt/lampp$ sudo ./xampp start
Starting XAMPP for Linux 5.6.14-3...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
Then I open localhost in the browser bringing me to the xampp dashboard. There I click on the phpMyAdmin menu entry, which gives me:
Error
MySQL said:
Cannot connect: invalid settings.
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server,
and the server rejected the connection.
You should check the host, username and password
in your configuration and make sure that they
correspond to the information given by the
administrator of the MySQL server.
I think that I made sure that the control user has the right pass.
The problem rather seems to be that MySQL does not really start although it says 'ok' (see above). Since, when I stop XAMPP, I get:
/opt/lampp$ sudo ./xampp stop
Stopping XAMPP for Linux 5.6.14-3...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...ok.
Looking at the error_log of xampp, there is a single entry, which looks suspicious (though I don't really understand it), saying:
[Sun Nov 15 11:38:59.737875 2015] [mpm_prefork:notice] [pid 6217] AH00169: caught SIGTERM, shutting down
So, if anybody is able to locate the problem or give me hints for a fix, I would really apreciate. Thanks already!
Edit - problem "fixed" (without knowing, what I've really done, though)
Here's the MySQL error-log (located at /opt/lampp/var/mysql/[computername].err):
2015-11-15 15:52:44 10864 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/
2015-11-15 15:52:44 140410457307008 [Note] Using unique option prefix 'key_buffer' is error-prone and can break in the future. Please use the full name 'key_buffer_size' instead.
2015-11-15 15:52:44 140410457307008 [Note] /opt/lampp/sbin/mysqld (mysqld 10.1.8-MariaDB) starting as process 11011 ...
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Memory barrier is not used
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Using CPU crc32 instructions
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Completed initialization of buffer pool
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: The log sequence numbers 3813213 and 3813213 in ibdata files do not match the log sequence number 9929741 in the ib_logfiles!
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Database was not shutdown normally!
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Starting crash recovery.
2015-11-15 15:52:44 140410457307008 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-11-15 15:52:44 140410457307008 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace bitnami_joomla/jos_content_frontpage uses space ID: 14 at filepath: ./bitnami_joomla/jos_content_frontpage.ibd. Cannot open tablespace phpmyadmin/pma__bookmark which uses space ID: 14 at filepath: ./phpmyadmin/pma__bookmark.ibd
2015-11-15 15:52:44 7fb3db6e3780 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./phpmyadmin/pma__bookmark.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
2015-11-15 15:52:44 10864 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/[computername].pid ended
First try: I made a backup of the directory /opt/lampp/var/mysql/phpmyadmin/ and added
innodb_force_recovery = 1
at the end of /opt/lampp/etc/my.conf. That gave me still the same error when starting MySQL again.
Next try was removing the file pma__bookmarks.idb from the directory, which had the effect that the error now complained about pma__favorites instead.
Finally, I removed all pma__*.idb-files and voila! MySQL is running, and I can access the phpMyAdmin-pages.
Works for me, though I don't know what was lost be removing the pma-databases? (They were not restored in any way, as it seems...)
Probably, the database-files were corrupted, when my computer went down, and they were still running!?
You must check whether mysqld process exist in top and then either try to connect with mysql command line client or review MySQL Error log. Sometimes xampp may be confused by MySQL Server which e.g. comes pre-installed with OS.

Log sequence number in ibdata files does not match

Everytime when I start my Mysql database I see this in the error_log:
131015 12:07:06 [Note] Plugin 'FEDERATED' is disabled. 131015 12:07:06
InnoDB: The InnoDB memory heap is disabled 131015 12:07:06 InnoDB:
Mutexes and rw_locks use Windows interlocked functions 131015 12:07:06
InnoDB: Compressed tables use zlib 1.2.3 131015 12:07:06 InnoDB:
Initializing buffer pool, size = 16.0M 131015 12:07:06 InnoDB:
Completed initialization of buffer pool 131015 12:07:06 InnoDB:
highest supported file format is Barracuda. InnoDB: The log sequence
number in ibdata files does not match InnoDB: the log sequence number
in the ib_logfiles! 131015 12:07:06 InnoDB: Database was not shut
down normally! InnoDB: Starting crash recovery. InnoDB: Reading
tablespace information from the .ibd files... InnoDB: Restoring
possible half-written data pages from the doublewrite InnoDB:
buffer... 131015 12:07:07 InnoDB: Waiting for the background threads
to start 131015 12:07:08 InnoDB: 5.5.32 started; log sequence number
1595695 131015 12:07:08 [Note] Server hostname (bind-address):
'0.0.0.0'; port: 3306 131015 12:07:08 [Note] - '0.0.0.0' resolves to
'0.0.0.0'; 131015 12:07:08 [Note] Server socket created on IP:
'0.0.0.0'.
I've tried mysqlcheck -u root -p --repair -A in order to repair the database. This reports that all tables are a-ok.
I've also tried setting innodb_force_recovery to 4
I've tried SET GLOBAL innodb_fast_shutdown = 1; and shutdown the DB.
None of these make the errors go away.
How do I repair the InnoDB tables in my database?
I resolve my problem by removing some files in "Xampp\mysql\data":
ib_logfile0
ib_logfile1
ibdata1
** Be Sure to Backup your DBs by :
[mysqld]
innodb_force_recovery = 2
(This command will help you to start Mysql in Read-only mode.)
LSN (log sequence number) may not match if MySQL crashed.
But if the crash recovery process finished you should be fine. If any transaction modifies data in a page, new LSN will be written to the page header.
I would investigate why MySQL crashes every time you restart it. To my knowledge /etc/init.d/mysql stop may take long time, so if you restart the server OS may just kill mysqld. In that case you should manually stop MySQL before reboot the whole server.
I had the same issue.
In my case, I was running MySQL on windows via XAMPP and using the XAMPP controls to start/stop the server.
It appears the XAMPP shutdown control was killing the MySQL server, rather than requesting a shutdown.
Solution
(optional) In my.ini set innodb_fast_shutdown=0 to configure mysqld to perform a full showdown
Create a .bat file, with contents mysqladmin --user=[user] --password=[password] shutdown replacing [user] and [password] with your root user details
When you wish to shutdown the MySQL server, just run the .bat file. The shutdown is detected by XAMPP control panel so you can restart using the XAMPP control.
If you now take a look at your logs, you'll see the errors have gone away
Or better yet, just install mysql as a windows service.
References:
innodb_fast_shutdown http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_fast_shutdown
mysqladmin shutdown - http://dev.mysql.com/doc/refman/5.7/en/server-shutdown.html

Mysql start up issues | ERROR! The server quit without updating PID file

Any Ideas?
Joshs-MacBook-Pro:cdwhp joshc$ mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Joshs-MacBook-Pro.local.pid).
Error Logs
120927 13:08:35 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
120927 13:08:36 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
120927 13:08:36 InnoDB: The InnoDB memory heap is disabled
120927 13:08:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120927 13:08:36 InnoDB: Compressed tables use zlib 1.2.5
120927 13:08:36 InnoDB: Initializing buffer pool, size = 128.0M
120927 13:08:36 InnoDB: Completed initialization of buffer pool
120927 13:08:36 InnoDB: highest supported file format is Barracuda.
120927 13:08:36 InnoDB: Waiting for the background threads to start
120927 13:08:37 InnoDB: 1.1.8 started; log sequence number 9531786
120927 13:08:37 [ERROR] /usr/local/Cellar/mysql/5.5.27/bin/mysqld: unknown variable 'default-character-set=utf8'
120927 13:08:37 [ERROR] Aborting
120927 13:08:37 InnoDB: Starting shutdown...
120927 13:08:37 InnoDB: Shutdown completed; log sequence number 9531786
120927 13:08:37 [Note] /usr/local/Cellar/mysql/5.5.27/bin/mysqld: Shutdown complete
120927 13:08:37 mysqld_safe mysqld from pid file /usr/local/var/mysql/Joshs-MacBook-Pro.local.pid ended
Complete reinstall of mysql solved this problem in my case:
brew uninstall mysql
rm -Rf /usr/local/var/mysql
brew install mysql
mysql.server start
Note: use this as last resort, all data will be deleted
I also had the same problem. I was doing
sudo mysql.server start
What I really should have been doing was running the command as my user (not su)
mysql.server start
Hope this helps someone.
The option default-character-set was removed in MySQL 5.5.3.
You should change it in my.cnf to the alternative;
character-set-server=utf8
I hope this helps but, I was having the same issue after I accidentally left mysql server running for a few days. I was getting
ERROR! The server quit without updating PID file (/usr/local/mysql/data/[NAS].pid).
I was able to fix it by typing
sudo kill 10191 - the process number for mysql on my computer
Then started up mysql again and it worked like fine. I hope this helps someone out of the same jam.
I found the log in bogon.log
InnoDB: The first innodb_system data file 'ibdata1' did not exist. A
new tablespace will be created! 2016-03-27T14:45:36.200398Z 0 [ERROR]
InnoDB: redo log file './ib_logfile0' exists. Creating system
tablespace with existing redo log files is not recommended. Please
delete all redo log files before creating new system tablespace. `
so I delete the ib* and mysql.server restart, that's work
use
`mysql.server status;` - tells you the process number/s
`sudo kill ######;` - enter process number repeat as needed
`mysql.server start;` - start everything up again
worked for me
I had a similar issue. Somehow the files YourComputerName.pid and "YourComputerName.err" in /usr/local/mysql/data were created under _mysql user. I just removed those files and started the sql server with the following command /usr/local/mysql/support-files/mysql.server start
delete file /usr/local/var/mysql/*********.local.err
run mysql.server start

Mysql problem: no mysql.sock

Yesterday I was working using MySQL installed on my computer.
I downloaded xampp, so I have I changed on my.cnf file the path to the socket:
/opt/lampp/var/mysql/mysql.sock
That file was just there. Today I wanted to keep working on it, and I found that file is not there anymore, so I am getting the following error while I am starting mysql server:
ERROR 2002 (HY000):
Can't connect to local MySQL server through socket
'/opt/lampp/var/mysql/mysql.sock' (2)
Here are some tests I made:
mujeresponja#ubuntu:~$ ps -fea | grep mysqld
1000 15707 15615 0 16:28 pts/1 00:00:00 grep --color=auto mysqld
mujeresponja#ubuntu:~$ ps -fea | grep mysql
1000 15709 15615 0 16:29 pts/1 00:00:00 grep --color=auto mysql
As a possible solution I uninstalled xampp and reinstall it, and also a new MySQL server, just in case. Anyway, that file is not there anymore.
EDIT
Where the mysql.sock should be, instead there are two files mysql_upgrade_info (Which contains just 5.5.8) and another binary file called ubuntu.err:
mujeresponja#ubuntu:/opt/lampp/var/mysql$ sudo cat ubuntu.err
110403 17:28:52 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
110403 17:28:52 [Note] Plugin 'FEDERATED' is disabled.
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110403 17:28:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
110403 17:28:52 InnoDB: Initializing buffer pool, size = 16.0M
110403 17:28:52 InnoDB: Completed initialization of buffer pool
110403 17:28:52 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
110403 17:28:52 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended
110403 17:29:22 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
110403 17:29:22 [Note] Plugin 'FEDERATED' is disabled.
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110403 17:29:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
110403 17:29:22 InnoDB: Initializing buffer pool, size = 16.0M
110403 17:29:22 InnoDB: Completed initialization of buffer pool
110403 17:29:22 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
110403 17:29:22 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended
(Sorry, I don't know how to show terminal messages in an appropiuate way)
Can anybody help me on this? Thanks in advance!
You can locate the actual socket file and create a symbolic link leading to it as follows:
# check path to socket from mysql settings
mysqladmin | grep d.sock
# create a symbolic link
ln -s path_to_mysql_socket /opt/lampp/var/mysql/mysql.sock
Although the test you did is a bit garbled, Im going to assume that the test just prove mysql isnt running.
Depending on how the mysql configured itself there should be a startup file somewhere, usually around the /etc/rc.* directories, and you would need to run the rc.mysql start (or it could be a S<nn>MySQL in an rc3.d directory for example
I didn't find a certain reason for my problem.
I just unisntalled and reinstalled, and then everything went Ok.
That is not a real solution, but it worked. Good luck
I came in the same situation when I made a grant to *.* to other user. Mysql tried to give permissions over the mysql database and that provoked the disaster: instantly, the mysql.sock file disappeared.
this happened with the version 5.6
I had the same problem with you, and I found some useful information:
2015-08-14 10:51:17 30934 [ERROR] InnoDB: Unable to lock /opt/lampp/var/mysql/ibdata1, error: 11
2015-08-14 10:51:17 30934 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
So, I rebooted the computer and restarted XAMPP, and the problem was resolved.