Error "mysqld dead but pid file exists" - mysql-error-1064

I get the error "mysqld dead but pid file exists"
I have a acache webclient running on EC2. With WordPress. I started seeing "error in Databse Connection"
When i do a sudo service mysqld status i See the error "mysqld dead but pid file exists"
Looks like I have enough space
[root#ip-10-0-0-149 log]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 7.8G 1.5G 6.3G 19% /
devtmpfs 486M 56K 486M 1% /dev
tmpfs 499M 0 499M 0% /dev/shm
Also when i do a tail I get
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
140717 21:04:58 InnoDB: Waiting for the background threads to start
140717 21:04:59 InnoDB: 5.5.38 started; log sequence number 6150055
140717 21:04:59 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140717 21:04:59 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140717 21:04:59 [Note] Server socket created on IP: '0.0.0.0'.
140717 21:04:59 [Note] Event Scheduler: Loaded 0 events
140717 21:04:59 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.38' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
Please Help !

in my case I did this and my problem solved.
cd /var/run/mysqld
rm -f mysqld.pid

Related

Xampp starts SQL than shuts down unexpectedly. No solution seems to work

so I wanted to start my SQL today and after I press on start I get this Message:
13:48:29 [mysql] Error: MySQL shutdown unexpectedly.
13:48:29 [mysql] This may be due to a blocked port, missing dependencies,
13:48:29 [mysql] improper privileges, a crash, or a shutdown by another method.
13:48:29 [mysql] Press the Logs button to view error logs and check
13:48:29 [mysql] the Windows Event Viewer for more clues
13:48:29 [mysql] If you need more help, copy and post this
13:48:29 [mysql] entire log window on the forums
I checked the error_log file and this inside.
InnoDB: using atomic writes.
2020-06-25 13:48:27 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-06-25 13:48:27 0 [Note] InnoDB: Uses event mutexes
2020-06-25 13:48:27 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-06-25 13:48:27 0 [Note] InnoDB: Number of pools: 1
2020-06-25 13:48:27 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-06-25 13:48:27 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-06-25 13:48:27 0 [Note] InnoDB: Completed initialization of buffer pool
2020-06-25 13:48:27 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-06-25 13:48:27 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-06-25 13:48:27 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-06-25 13:48:27 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2020-06-25 13:48:27 0 [Note] InnoDB: Waiting for purge to start
2020-06-25 13:48:27 0 [Note] InnoDB: 10.4.13 started; log sequence number 5299770; transaction id 988
2020-06-25 13:48:27 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2020-06-25 13:48:27 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-06-25 13:48:27 0 [Note] InnoDB: Buffer pool(s) load completed at 200625 13:48:27
2020-06-25 13:48:27 0 [Note] Server socket created on IP: '::'.
I already tried these solutions to fix the problem:
Nothing else is blocking the port. Not Skype not anything.
Deleted the ibtmp1 file and ib_... log files and restarted the Server.
Changed the port from 3306 to 3307.
Changed max_allowed_packet from 1M to 128M
End mysql task in task manager (This does not work because I have no such task running)
This is the third time this is happening. The only way I can get it to work again if I reinstall xampp. But it takes like 30 min to connect everything again and import my tables again. Also I have to constantly export my tables so I dont loose any changes.
Is there anything else i can try?

Cannot connect to mySQL after recovering InnoDB tables without Ibdata1 file [xampp and localhost]

First of all, you should know that I have few knowledge of mySQL, databases, xampp and so on. I will try to explain my problem the best I can.
Secondly, notice that I have already searched for solutions in this site and others, but I do not find anyone that applies to my specific situation.
I was developing my first wordpress website using bitnami_wordpress and xampp. A few days ago I had a problem connecting to a mySQL local server. Due to my ignorance, when I was trying to solve my problem, I ended up overwriting the ibdata1 file from my xampp/mysql/data folder with the one stored in xampp\mysql\backup. Big mistake! The backup may be too old and now my database was "corrupted". When I tried to access the tables in the phpmyadmin panel there was a message saying "table doesn't exist in engine".
I looked for solutions in the net and I finally decided to follow these steps to restore my data: https://zadpen.com/20-restore-lost-data-in-mysql-using-innodb-engine-without-file-ibdata1.html
These are the main steps:
Add innodb_file_per_table=1 in xampp\mysql\bin\my.ini
Create a new database for the website (I used same name as the original one while I changed the name of the old one)
Recovering the tables structure of the old database. For example: mysqlfrm --server=root:#localhost:3306 wp_cn_social_icon.frm --port 3333 > wp_cn_social_icon.sql
Creating the table using the SQL statements of the previous step.
Discard the .ibd files of the new database ALTER TABLE wp_cn_social_icon DISCARD TABLESPACE;
Copying the original .ibd file from the old database to the new one.
"linking" the .ibd to the .frm file of the new database: ALTER TABLE wp_cn_social_icon IMPORT TABLESPACE;
I repeated these steps for all the tables.
It worked. I was able to see again all the data in the tables in the phpmyadmin control panel! I was so happy! HOWEVER, happiness lasted a few minutes. As soon as I stopped Xampp and restarted it again, I found up that I was able to access other databases in the phpMyAdmin panel, but not the website database I was interested in. This was the error:
I think nothing is wrong in the configInc.php file...is it?
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1:3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
I then tried to connect to the server through the Windows CMD (I didnt' know what to do... I was just desperate) I used the command: mysql -u root -p. And then I write down: mysql use website_database. After doing this, the connection was interrupted and I have not been able to start again the mysql server.
Now Xampp shows this error everytime I attempt to start MySQL.
16:45:33 [mysql] Attempting to start MySQL app...
16:45:33 [mysql] Status change detected: running
16:45:36 [mysql] Status change detected: stopped
16:45:36 [mysql] Error: MySQL shutdown unexpectedly.
16:45:36 [mysql] This may be due to a blocked port, missing dependencies,
16:45:36 [mysql] improper privileges, a crash, or a shutdown by another method.
16:45:36 [mysql] Press the Logs button to view error logs and check
16:45:36 [mysql] the Windows Event Viewer for more clues
16:45:36 [mysql] If you need more help, copy and post this
16:45:36 [mysql] entire log window on the forums
The mysql_error.log file shows this:
2020-06-06 16:45:34 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-06-06 16:45:34 0 [Note] InnoDB: Uses event mutexes
2020-06-06 16:45:34 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-06-06 16:45:34 0 [Note] InnoDB: Number of pools: 1
2020-06-06 16:45:34 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-06-06 16:45:34 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-06-06 16:45:34 0 [Note] InnoDB: Completed initialization of buffer pool
2020-06-06 16:45:34 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-06-06 16:45:34 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-06-06 16:45:34 0 [Note] InnoDB: Setting file 'C:\Program Files\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-06-06 16:45:34 0 [Note] InnoDB: File 'C:\Program Files\xampp\mysql\data\ibtmp1' size is now 12 MB.
2020-06-06 16:45:34 0 [Note] InnoDB: Waiting for purge to start
2020-06-06 16:45:34 0 [Note] InnoDB: 10.4.11 started; log sequence number 896271; transaction id 990
2020-06-06 16:45:34 0 [Note] InnoDB: Loading buffer pool(s) from C:\Program Files\xampp\mysql\data\ib_buffer_pool
2020-06-06 16:45:34 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-06-06 16:45:34 0 [Note] Server socket created on IP: '::'.
I did not change any connection settings... I Just followed the steps of that website to recover the data. What may be wrong? I must be doing something wrong or missing something related with the connecting settings.
PS: Just in case, I found strange that Ibdata1 file weighs now almost 70Mb...

XAMPP – MySQL shutdown unexpectedly

I've just installed XAMPP, and when I try to start my Apache and MySQL in the XAMPP Control Panel, I now get the following errors:
19:27:08 [mysql] Error: MySQL shutdown unexpectedly.
19:27:08 [mysql] This may be due to a blocked port, missing dependencies,
19:27:08 [mysql] improper privileges, a crash, or a shutdown by another method.
19:27:08 [mysql] Press the Logs button to view error logs and check
19:27:08 [mysql] the Windows Event Viewer for more clues
19:27:08 [mysql] If you need more help, copy and post this
19:27:08 [mysql] entire log window on the forums
InnoDB: using atomic writes.
2020-03-17 19:10:21 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-03-17 19:10:21 0 [Note] InnoDB: Uses event mutexes
2020-03-17 19:10:21 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-03-17 19:10:21 0 [Note] InnoDB: Number of pools: 1
2020-03-17 19:10:21 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-03-17 19:10:21 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-03-17 19:10:21 0 [Note] InnoDB: Completed initialization of buffer pool
2020-03-17 19:10:21 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=300288
2020-03-17 19:10:22 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-03-17 19:10:22 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-03-17 19:10:22 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-03-17 19:10:22 0 [Note] InnoDB: Setting file 'D:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-03-17 19:10:22 0 [Note] InnoDB: File 'D:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2020-03-17 19:10:22 0 [Note] InnoDB: Waiting for purge to start
2020-03-17 19:10:22 0 [Note] InnoDB: 10.4.11 started; log sequence number 300297; transaction id 171
2020-03-17 19:10:22 0 [Note] InnoDB: Loading buffer pool(s) from D:\xampp\mysql\data\ib_buffer_pool
2020-03-17 19:10:22 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-03-17 19:10:22 0 [Note] Server socket created on IP: '::'.
This is as a result of some files in C:\xampp\mysql\data\mysql getting corrupted.
first of all, try to end the task in task manager mysqlid.exe end and start again MySQL in Xampp, if there is the same error try this below solution. please backup that data.
Solution:
Back up C:\xampp\mysql\data
Copy all file C:\xampp\mysql\backup
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.
this solution work for me its link here
I think you can check the ports were used by some application on your windows.
You can change the port:
Go to your xampp folder, find the mysql.cnf or mysql.ini to change the port 3306 to others
Then restart again.
If in your XAMPP control panel when you try to start the mysql it starts by getting PID and port number(3306) and then shutdowns unexpectedly.
The solution which worked for me is just go to your "C:\xampp\mysql\bin" directory (If you have installed on other location go to bin folder of mysql in that) and doubleclick the
mysqld.exe file.It will start working.
It also works using cmd (If you have installed XAMMP in other directory change the path accordingly.)
cd C:\xampp\mysql\bin
mysqld
Follow the steps this may resolve your issue
Close Xampp.
Go to \xampp\mysql\backup.
Copy all files in directory except ibdata1.
Go to \xampp\mysql\data.
Paste the files that you copied from \xampp\mysql\ backup (Replace the files when asked).
Start Xampp.

CentOS 6.5 - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Before I start, I'd like to state that I have tried exhausting all Stack Overflow posts asking this same question, but either none of their recommended answers apply (which is absurdly improbable), or I just wasn't able to find the right answer yet. Hence the following post:
First of all, I am not proficient at all regarding coding. However, in my job, which is managing the WordPress website of an Internet television network (meaning I schedule hourly updates of our online video content every day), I have to teach myself how to understand very basic coding in case emergencies happen. This is such an emergency. In doing advanced scheduling for our online content, I opened too many tabs and triggered a WordPress error:
Error establishing a database connection
This has happened before, and I managed to fix the error then by finding the answer sudo service mysqld start; here. However, when it reoccurred again today, simply redoing what I did before didn't work any more. Thus I tried following some other answers as much as my limited understanding of code can help me get. Some other similar queries. No answers so far were able to help me, or maybe I just don't understand how they work.
From what I gathered, my problem is
Trying the previous solution failed:
[root#li725-222 ~]# sudo service mysqld start;
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
This, from my mysqld.log:
171217 05:19:05 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
171217 05:19:16 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
171217 5:19:16 [Note] /usr/libexec/mysqld (mysqld 5.5.53) starting as process 27761 ...
171217 5:19:16 [Note] Plugin 'FEDERATED' is disabled.
171217 5:19:16 InnoDB: The InnoDB memory heap is disabled
171217 5:19:16 InnoDB: Mutexes and rw_locks use GCC atomic builtins
171217 5:19:16 InnoDB: Compressed tables use zlib 1.2.3
171217 5:19:16 InnoDB: Using Linux native AIO
171217 5:19:16 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
171217 5:19:16 InnoDB: Completed initialization of buffer pool
171217 5:19:16 InnoDB: Fatal error: cannot allocate memory for the buffer pool
171217 5:19:16 [ERROR] Plugin 'InnoDB' init function returned error.
171217 5:19:16 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
171217 5:19:16 [ERROR] Unknown/unsupported storage engine: InnoDB
171217 5:19:16 [ERROR] Aborting
171217 5:19:16 [Note] /usr/libexec/mysqld: Shutdown complete
171217 05:19:16 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Searching for InnoDB: Fatal error: cannot allocate memory for the buffer pool on Google, I found this guide. Doing this suggestion didn't yield results (maybe I did it wrong, or maybe the solution is not applicable?):
(1) Increase the physical RAM. Adding 1GB of additional RAM will solve
the problem.
(2) Allocate SWAP space. Digital Ocean VPS instance is not configured
to use swap space by default. By allocating 512MB of swap space, we
were able to solve this problem. To add swap space to your server,
please follow the following steps:
## As a root user, perform the following:
# dd if=/dev/zero of=/swap.dat bs=1024 count=512M
# mkswap /swap.dat
# swapon /swap.dat
## Edit the /etc/fstab, and the following entry. /swap.dat none swap sw 0 0
(3) Reduce the size of MySQL buffer pool size
## Edit /etc/my.cnf, and add the following line under the [mysqld] heading. [mysqld] innodb_buffer_pool_size=64M
Restart mysql and you're good to go.
I tried some of the answers in this thread as well but I don't think any of them worked.
Our website is hosted in Linode and is running on CentOS 6.5.
P.S. I have just noticed that my mysqld.log had ballooned in size from 754kb to ~881.97mb. I don't know the reason but of course it must have something to do with my attempted fixes. I recall deleting the files /var/lib/mysql/ib_logfile0 and /var/lib/mysql/ib_logfile1 as per the advice of one of the solutions I tried (I backed them up first, of course). The difference between the mysqld.log then and now is that in the latest version, these text strings have been added:
171217 05:19:16 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
171217 05:39:42 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
171217 5:39:42 [Note] /usr/libexec/mysqld (mysqld 5.5.53) starting as process 28073 ...
171217 5:39:42 [Note] Plugin 'FEDERATED' is disabled.
171217 5:39:42 InnoDB: The InnoDB memory heap is disabled
171217 5:39:42 InnoDB: Mutexes and rw_locks use GCC atomic builtins
171217 5:39:42 InnoDB: Compressed tables use zlib 1.2.3
171217 5:39:42 InnoDB: Using Linux native AIO
171217 5:39:42 InnoDB: Initializing buffer pool, size = 64.0M
171217 5:39:42 InnoDB: Completed initialization of buffer pool
171217 5:39:42 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
171217 5:39:42 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
171217 5:39:42 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!
171217 5:39:42 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...
171217 5:39:42 InnoDB: Error: page 1 log sequence number 1118101582
InnoDB: is in the future! Current system log sequence number 580967436.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information.
171217 5:39:42 InnoDB: Error: page 4 log sequence number 1099567460
InnoDB: is in the future! Current system log sequence number 580967436.
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: for more information...
..with that last paragraph looping and looping up until the moment (maybe it is still updating).

Error Xamp doesn't work

After loading a database on xamp, the program doesn't work
This is the log file
2016-09-28 14:46:03 115c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2016-09-28 14:46:03 4444 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-09-28 14:46:03 4444 [Note] InnoDB: The InnoDB memory heap is disabled
2016-09-28 14:46:03 4444 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-09-28 14:46:03 4444 [Note] InnoDB: Memory barrier is not used
2016-09-28 14:46:03 4444 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-09-28 14:46:03 4444 [Note] InnoDB: Not using CPU crc32 instructions
2016-09-28 14:46:03 4444 [Note] InnoDB: Initializing buffer pool, size = 160.0M
2016-09-28 14:46:03 4444 [Note] InnoDB: Completed initialization of buffer pool
2016-09-28 14:46:03 4444 [Note] InnoDB: Highest supported file format is Barracuda.
2016-09-28 14:46:03 4444 [Note] InnoDB: The log sequence numbers 1835037 and 1835037 in ibdata files do not match the log sequence number 2351448096 in the ib_logfiles!
2016-09-28 14:46:03 4444 [Note] InnoDB: Database was not shutdown normally!
2016-09-28 14:46:03 4444 [Note] InnoDB: Starting crash recovery.
2016-09-28 14:46:03 4444 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-09-28 14:46:03 4444 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace american/ps_desktop_menu_tabs_shop uses space ID: 13969 at filepath: .\american\ps_desktop_menu_tabs_shop.ibd. Cannot open tablespace american2/ps_desktop_menu_tabs_shop which uses space ID: 13969 at filepath: .\american2\ps_desktop_menu_tabs_shop.ibd
InnoDB: Error: could not open single-table tablespace file .\american2\ps_desktop_menu_tabs_shop.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.
How i can solve?
I can't reinstall the program because i've a lot of database for work
first, go to services and search for MySQL services after getting it to delete the services and restart the camp will work fine
go check your Xamp folder file in cfolder that probelem fixed.to erase that problem to comeagain xamp is worked.

Resources