Error 1067: The process terminated unexpectedly when trying to start MySQL - mysql

I have WAMP server version 2.2. Previously, MySQL Server running normally.
I don't know why when I tried to start, it cannot start anymore.
Here are the content of MySQL.log:
140502 21:04:46 [Note] Plugin 'FEDERATED' is disabled.
140502 21:04:47 InnoDB: The InnoDB memory heap is disabled
140502 21:04:47 InnoDB: Mutexes and rw_locks use Windows interlocked functions
140502 21:04:47 InnoDB: Compressed tables use zlib 1.2.3
140502 21:04:47 InnoDB: Initializing buffer pool, size = 128.0M
140502 21:04:47 InnoDB: Completed initialization of buffer pool
140502 21:04:47 InnoDB: highest supported file format is Barracuda.
140502 21:04:47 InnoDB: Waiting for the background threads to start
140502 21:04:48 InnoDB: 1.1.8 started; log sequence number 1595675
140502 21:04:48 [Note] Server hostname (bind-address): '(null)'; port: 3306
140502 21:04:48 [Note] - '(null)' resolves to '::';
140502 21:04:48 [Note] - '(null)' resolves to '0.0.0.0';
140502 21:04:48 [Note] Server socket created on IP: '0.0.0.0'.
140502 21:04:48 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
140502 21:04:48 [ERROR] Do you already have another mysqld server running on port: 3306 ?
140502 21:04:48 [ERROR] Aborting
140502 21:04:48 InnoDB: Starting shutdown...
140502 21:04:49 InnoDB: Shutdown completed; log sequence number 1595675
140502 21:04:49 [Note] wampmysqld: Shutdown complete
I had already tried to reinstall WAMP server but appear the same error.
Can someone help me, please...

It's possible that the port is trying to be opened by another storage engine than InnoDB. Refer to this article for some commands that can help you identify what's happening.
For instance, netstat -an | findstr "3306"
danielschneller.com/2007/10/cant-start-server-bind-on-tcpip-port-no.html

Something is already working on that port. In administrator CMD console write
netstat -abn
and find port 3306, then you will know what is blocking the port (what is already running on it and blocks your mysql).
If that doesnt help you then check my.ini settings
In that file search for
socket = /something
and change that to
socket = c:/something

I had the same problem with Windows 7 32-bit.
Cause
Some filenames are reserved by Windows, such as ${machinename}.pid, ${machinename}.err, etc.
MySQL uses some of these filenames by default.
Solution
After the installation is complete, during the configuration phase, there's an Advanced option using which you can change these filenames. You can change the log file names but not the pid file name.
You need to step through the configuration wizard to the "starting service" step, and then it will throw an error/warning message. Leave the wizard paused (do not stop/cancel the wizard).
By now, your my.ini file has been created. You can add the following variable
pid_file=/path/to/pid/file.pid
Then go to Windows Services and start the service.
N.B. DO NOT STOP/CANCEL THE WIZARD.
Once the service is started, the wizard will continue, and will configure MySQL properly.

setting file my.ini :
innodb_flush_method=normal

Related

Mysql can't start due to 3306 busy [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I recently moved my old server to EC2 and cannot run mysql in the new EC2 instance. I ran sudo service mysql start and get start: Job failed to start as return. Here is the error log
210525 15:04:41 [Note] Plugin 'FEDERATED' is disabled.
210525 15:04:41 InnoDB: The InnoDB memory heap is disabled
210525 15:04:41 InnoDB: Mutexes and rw_locks use GCC atomic builtins
210525 15:04:41 InnoDB: Compressed tables use zlib 1.2.3.4
210525 15:04:41 InnoDB: Initializing buffer pool, size = 128.0M
210525 15:04:41 InnoDB: Completed initialization of buffer pool
210525 15:04:41 InnoDB: highest supported file format is Barracuda.
210525 15:04:41 InnoDB: Waiting for the background threads to start
210525 15:04:42 InnoDB: 5.5.54 started; log sequence number 4021966302
210525 15:04:42 [Note] Server hostname (bind-address): '111.1.111.111'; port: 3306
210525 15:04:42 [Note] - '111.1.111.111' resolves to '111.1.111.111';
210525 15:04:42 [Note] Server socket created on IP: '111.1.111.111'.
210525 15:04:42 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address
210525 15:04:42 [ERROR] Do you already have another mysqld server running on port: 3306 ?
210525 15:04:42 [ERROR] Aborting
210525 15:04:42 InnoDB: Starting shutdown...
210525 15:04:43 InnoDB: Shutdown completed; log sequence number 4021966000
210525 15:04:43 [Note] /usr/sbin/mysqld: Shutdown complete
I'm new to this and wasn't sure what to do. I tried to see if 3306 is been using but when I ran sudo netstat -nlp I didn't see 3306 on the list. I export my old VM as ova and upload it to S3 -> AMIs -> create instance.
try to use this netstat -nlp|grep 3306 when you identify it, then use killall <process>
Due to the new server was created by my old server's snapshot, it copy everything including the bind address. I change the bind address to "127.0.0.1" and now mysql is running.
What I did:
sudo less /var/log/mysql/error.log (to find out the errors)
If you have the same error as what I have then check the my.cnf file's bind address. /etc/mysql/my.cnf
Change the bind address.
run sudo service mysql start
Reference:
https://bobcares.com/blog/mysql-bind-address-ubuntu/
https://serversforhackers.com/c/mysql-network-security

Error in starting MYSQL in XAMPP

When I start xampp it gives me an error in mysql. I'm using windows 10.
Here is the contents of error log:
2015-11-10 15:26:56 10fc 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.
2015-11-10 15:26:56 4348 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2015-11-10 15:26:56 4348 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-10 15:26:56 4348 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-11-10 15:26:56 4348 [Note] InnoDB: Memory barrier is not used
2015-11-10 15:26:56 4348 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-10 15:26:56 4348 [Note] InnoDB: Not using CPU crc32 instructions
2015-11-10 15:26:56 4348 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2015-11-10 15:26:56 4348 [Note] InnoDB: Completed initialization of buffer pool
2015-11-10 15:26:56 4348 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-10 15:26:57 4348 [Note] InnoDB: 128 rollback segment(s) are active.
2015-11-10 15:26:57 4348 [Note] InnoDB: Waiting for purge to start
2015-11-10 15:26:57 4348 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.26-74.0 started; log sequence number 1835027
2015-11-10 15:26:57 6140 [Note] InnoDB: Dumping buffer pool(s) not yet started
2015-11-10 15:26:57 4348 [Note] Plugin 'FEEDBACK' is disabled.
2015-11-10 15:26:57 4348 [Note] Server socket created on IP: '::'.
2015-11-10 15:26:57 4348 [Note] Event Scheduler: Loaded 0 events
2015-11-10 15:26:57 4348 [Note] C:\xampp\mysql\bin\mysqld.exe: ready for connections.
Version: '10.1.8-MariaDB' socket: '' port: 3306 mariadb.org binary distribution
2015-11-10 15:27:11 5152 [Note] C:\xampp\mysql\bin\mysqld.exe: Normal shutdown
When I opened XAMPP and click start MySQL button it gives me an error.
9:12:53 PM [mysql] Error: MySQL shutdown unexpectedly.
9:12:53 PM [mysql] This may be due to a blocked port, missing dependencies,
9:12:53 PM [mysql] improper privileges, a crash, or a shutdown by another method.
9:12:53 PM [mysql] Press the Logs button to view error logs and check
9:12:53 PM [mysql] the Windows Event Viewer for more clues
9:12:53 PM [mysql] If you need more help, copy and post this
9:12:53 PM [mysql] entire log window on the forums
UPDATE
Here is the screenshot:
First: Close Xampp.
Second: Go to \xampp\mysql\backup.
Third: Copy all files in directory except ibdata1.
Fourth: Go to \xampp\mysql\data.
Fifth: Paste the files that you copied from \xampp\mysql\ backup
(Replace the files when asked).
Sixth: Start Xampp.
Follow these steps properly and carefully.
This error is caused because there is already MySQL installed (of different version) which is using port 3306.
On the xampp control panel you will find 'MySQL' and several options like Start, Config, etc beside that.
Select Config and open the file named 'my.ini'. It should open in a notepad. Press Ctrl + F and Find '3306' and change it to 3308 and Save the file.
NOTE: YOU WILL FIND 5 INSTANCES OF 3306. CHANGE ALL OF THEM TO 3308.
Now Open the Config which is located on the top-right of the Xampp control panel. A window should appear. Find 'Service and Port setting'. Click the button and once again a window should appear.
5.On the MySQL tab type '3308'. And Save the changes.
6.Search 'services.msc' on Windows search. A Window should popup. Scroll down until you find 'MySQL'.
Right click on MySQL and select STOP.
Now Run Command Prompt as administrator and type the following command.
sc delete mysql
This will successfully delete previously installed mysql.
Quit the xampp control panel completely and start a new fresh one.
Now your MySQL should be up and running.
Probably your 3306 or whatever you use is being used by other applications. May be you don't know that XAMPP usually has problems with apps like Skype. If you are running Skype try to close it and open XAMPP. You can also change default ports for HTTP and MySQL.
To Edit Apache ports open apache.conf and restart the server.
To Edit MySql ports open my.cnf and restart the service.
You may also take a look to this post. May be you need to delete your DB files due corruption but it may be not the reason if you just installed fresh Xampp instance.
XAMPP - MySQL shutdown unexpectedly
UPDATE
Here you have a good screenshot of how to change ports on Skype if you prefer.
https://stackoverflow.com/a/16351807/3518053
The problem is that you have two instances of mysql installed in your computer. Check if the process mysqld.exe is already running via task manager and terminate it if present. Then open services.msc via run and remove all instances of mysql if any(terminate it before removing), reboot your machine and run XAMPP again. This will solve your problem.
I came across a similar problem, you can try this here
Remember to backup your data first!
Using cmd as administrator uninstall
xampp
all mysql database
mysql service
then remove the service using sc delete and remove all directory of XAMPP. Then reinstall it again.

Can't run mysql server on xampp

I just installed xampp server on Windows XP machine and can't run mysql. Here is a it's error log file text:
151225 10:41:21 [Note] Plugin 'FEDERATED' is disabled.
151225 10:41:21 InnoDB: The InnoDB memory heap is disabled
151225 10:41:21 InnoDB: Mutexes and rw_locks use Windows interlocked functions
151225 10:41:21 InnoDB: Compressed tables use zlib 1.2.3
151225 10:41:21 InnoDB: Initializing buffer pool, size = 16.0M
151225 10:41:21 InnoDB: Completed initialization of buffer pool
151225 10:41:21 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
151225 10:41:21 [ERROR] Plugin 'InnoDB' init function returned error.
151225 10:41:21 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
151225 10:41:21 [ERROR] Unknown/unsupported storage engine: InnoDB
151225 10:41:21 [ERROR] Aborting
151225 10:41:21 [Note] c:\xampp\mysql\bin\mysqld.exe: Shutdown complete
Steps I have tried include: removing lblogfile0 and lblogfile1 files from data directory, removing innoDB directory path from mysql config file. Does anyone have any ideas about this issue?
Try Re-installing the Xampp.
Check port are clear and open
From XAMPP Windows Help
Microsoft delivers a better firewall with service pack 2 (SP2), which starts automatically. This firewall now blocks the necessary ports 80 (http) and 443 (https) and Apache can't start.
The fast solution:
Disable the Microsoft firewall with the toolbar and try to start XAMPP onces more. The better solution is to define an exception within the security center.
The following ports are used for basic functionality:
Apache (HTTP): Port 80
Apache (WebDAV): Port 81
Apache (HTTPS): Port 443
MySQL: Port 3306
FileZilla (FTP): Port 21
FileZilla (Admin): Port 14147
Mercury (SMTP): Port 25
Mercury (POP3): Port 110
Mercury (IMAP): Port 143
Mercury (HTTP): Port 2224
Mercury (Finger): Port 79
Mercury (PH): Port 105
Mercury (PopPass): Port 106
Tomcat (AJP/1.3): Port 8009
Tomcat (HTTP): Port 8080
From the log it seems that InnoDB engine is failing to allocate the datafiles. Best way would be to uninstall and reinstall. Also check which version is compatible with Windows XP, since the newest one isn't (you need 1.8.2).

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

No connection could be made because the target machine actively refused it (PHP / WAMP)

Note: I realise this could be seen as a duplicate but i have looked at the other responses and they didn't fix the problem for me.
I have recently installed Zend Studio and Zend Server with the mysql plugin on Windows 7.
I am not a qualified server administrator but neither am i completely incompetent; i have dedicated my day trying to get a local development 'server' up to cut down on upload/download times.
When I say server/machine i mean my home computer
I have come to a grinding halt trying to get mysql to work with Zend Server.
The error I keep receiving is (or verbose):
#2002 Cannot log in to the MySQL server
or (if i change to 'config' authentication type)
#2002 - No connection could be made because the target machine actively refused it.
The server is not responding (or the local server's socket is not correctly configured).
I have tried:
Change $cfg['Servers'][$i]['host'] from 'localhost' to '127.0.0.1'
Add/Remove $cfg['Servers'][$i]['socket'] = '';
Change from cookie to config auth type
reinstall server and mysql
Disable firewalls
Restarting machine
Zend's approach was to 'configure the phpmyadmin setup screen'... done that i don't know how many times.
Can anyone on here lend a hand, or point me in a direction that I haven't tried yet?
Go to C:\wamp\bin\mysql\mysql[your-version]\data
Copy and save "ib_logfile0" and "ib_logfile1" anywhere else.
delete "ib_logfile0" and ib_logfile1
Did the trick for me. hope it works for you too.
Its working fine.
But we will have to stop apache and mysql, We need to quit xampp and then delete file. when deleted successfully. now start xampp it will work properly..
Just Go to your Control-panel and start Apache & MySQL Services.
You might need:
In wamp\bin\mysql\mysqlX.X.XX\my.ini find these lines:
[client]
...
port = 3308
...
[wampmysqld64]
...
port = 3308
As you see, the port number is 3308 (or maybe 3306). You should :
use that port in applications, like WordPress: define('DB_HOST', 'localhost:3308')
or
change it globally in wamp\bin\apache\apache2.X.XXX\bin\php.ini change
mysqli.default_port = ... to 3308
Till yesterday I was able to connect to phpMyAdmin, but today I started getting this error:
2002-no-connection-could-be-made-because-the-target-machine-actively-refused
None of the answers here really helped me fix the problem, what helped me is shared below:
I looked at the mysql logs.[C:\wamp\logs\mysql.log]
It said
2015-09-18 01:16:30 5920 [Note] Plugin 'FEDERATED' is disabled.
2015-09-18 01:16:30 5920 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-09-18 01:16:30 5920 [Note] InnoDB: The InnoDB memory heap is disabled
2015-09-18 01:16:30 5920 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-09-18 01:16:30 5920 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-09-18 01:16:30 5920 [Note] InnoDB: Not using CPU crc32 instructions
2015-09-18 01:16:30 5920 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-09-18 01:16:30 5920 [Note] InnoDB: Completed initialization of buffer pool
2015-09-18 01:16:30 5920 [Note] InnoDB: Highest supported file format is Barracuda.
2015-09-18 01:16:30 5920 [Note] InnoDB: The log sequence numbers 1765410 and 1765410 in ibdata files do not match the log sequence number 2058233 in the ib_logfiles!
2015-09-18 01:16:30 5920 [Note] InnoDB: Database was not shutdown normally!
2015-09-18 01:16:30 5920 [Note] InnoDB: Starting crash recovery.
2015-09-18 01:16:30 5920 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-09-18 01:16:30 5920 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace harley/login_confirm uses space ID: 6 at filepath: .\harley\login_confirm.ibd. Cannot open tablespace testdb/testtable which uses space ID: 6 at filepath: .\testdb\testtable.ibd
InnoDB: Error: could not open single-table tablespace file .\testdb\testtable.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.
I got the clue that this guy is creating a problem - InnoDB: Error: could not open single-table tablespace file .\testdb\testtable.ibd
and this line 2015-09-18 01:16:30 5920 [Note] InnoDB: Database was not shutdown normally!
hmmm, For me the testdb was just a test-db! hence I decided to delete this file inside C:\wamp\bin\mysql\mysql5.6.17\data\testdb
and restarted all services, and went to phpMyAdmin, and this time no issues, phpMyAdmin opened :)
I'm having the same problem with Wampserver. It’s worked for me:
You must change this file: "C:\wamp\bin\mysql[mysql_version]\my.ini"
For example: "C:\wamp\bin\mysql[mysql5.6.12]\my.ini"
And change default port 3306 to 80. (Lines 20 & 27, in both)
port = 3306
To
port = 80
I hope this is helpful.
All I have to do in order to get rid of that error was to restart my wamp server.
In my case i did the following and worked for me
I clicked on the wamp icon.
i went to MySQL > Service administration 'wampmysqld64' > install service
Then click on wamp icon > Restart all service.
Please check your hosts file in etc folder and add below comments then run wamp server.
127.0.0.1 localhost
Path : C:\Windows\System32\drivers\etc
I have just removed the mysql service and installed it again. It works for me
Kindly check is your mysql-service is running.
for windows user: check the services - mysql service
for Linux user: Check the mysql service/demon is running (services mysql status)
Thanks & Regards
Jaiswar Vipin Kumar R
following steps worked for me.
Go to wamp\apps\phpmyadmin
search config.inc.php
search 127.0.0.1 and replace with "localhost".