Mysql Shutdown Unexpectedly while upgrading mysql 5.7 - php

I am trying to upgrade my mysql in XAMPP.
PHP Version => 5.6.3
old mysql version => 5.6.21 Need to upgrade =>5.7.22(Which was only available to download in 5.7 series)
I followed these steps to upgrade:
Download latest MySQL but download the zip file not the MSI
Unzip the zip file to a location.
Shutdown Mysql process (no need to remove service) from XAMPP control panel.
Go to XAMPP folder, rename mysql folder to mysql_old
Copy the new unzipped mysql folder to XAMPP folder, in it delete the data folder.
Copy over the data folder from the mysql_old to the new mysql folder.
Copy over the my.ini file under mysql_old/bin to mysql/bin.
Copy over other ini and executable files from mysql_old root folder to mysql (XAMPP ini files, my-huge.ini, my-small.ini, etc..). in my case i copied my-default.ini
Run mysql process from XAMPP control panel. Should work. (You may need
to kill XAMPP first).-->Here I struck out and facing mysql shutdown error.
(OPTIONAL) Run mysql/bin/mysql_upgrade.exe -u USERNAME -p to update tables in the local databases that may have problems due to the version change.
I tried
1.change port as 3307,3306,8111 in my.ini file as others suggested.
2.Go to mysql/data/ directory
delete the ibdata1 & ib_logfile*(ib_logfile0,ib_logfile1,ib_logfile101) file
restart xampp server
mysql_error.log shows Following :
2018-05-04T06:31:04.062353Z 0 [Note] c:\mysql-upgradexampp\sm3\xampp\mysql\bin\mysqld.exe (mysqld 5.7.22) starting as process 9428 ...
I ran XAMPP Control Panel as Administrator,but still it shows
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
With Command Prompt ,I am getting following Error
\mysql\bin>mysql -u root -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
Please Some one give advice to resolve .Thanks

Related

Mysql not working on mac Sierra after upgrading php

I recently upgraded my laravel valet to version 2 which installed php 7.2 through brew. I had previously been on php 7.1. I ran into a few bumps but got php and valet working but once I did I noticed mysql is no longer working. If I do brew services start mysql it shows successful but if I type mysql -v I get the following error message. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
If I type mysql.server start I get the following error message
./usr/local/Cellar/mysql/8.0.17_1/bin/mysqld_safe: line 674: /Users/swany/.valet/Log/mysql.log: No such file or directory
2019-09-11T17:24:54.6NZ mysqld_safe error: log-error set to '/Users/swany/.valet/Log/mysql.log', however file don't exists. Create writable for user 'mysql'.
/usr/local/Cellar/mysql/8.0.17_1/bin/mysqld_safe: line 144: /Users/swany/.valet/Log/mysql.log: No such file or directory
ERROR! The server quit without updating PID file (/usr/local/var/mysql/Chriss-MacBook-Pro-2.local.pid).
I have seen others with similar issues but when i walked through some of the solutions they didn't seem to work for me. I am hoping to be able to save all my databases I already have when mysql was running. I didn't try to upgrade mysql but it may tried as part of the valet upgrade.
Check to see if there is a mysql process still running. Run the following command:
ps aux | grep -i mysql
If you see any processes running then kill them using the
kill -9 PID
Where PID = Process ID of the MySQL process.
After the processes have been terminated, try restarting mysql and see if this solved your problem.

MySQL does not start in Xampp control panel in Windows 8.1

After the successful installation of Xampp on my Windows 8.1 64-bit system, the Apache server is starting fine but MySQL is not starting.
There is no error showing in the control panel log. I changed the port 3306 to 3307 in the my.ini file in the lib folder, but no change has occurred.
This is the screenshot of xampp control panel log when I click on the mysql start button
let xampp run as administrator and open the services make sure you stopped running the mysql service and uninstall the mysql under service in xampp control and install and start.

Running 2 xampp on same local computer

11:05:16 AM [Apache] Apache Service detected with wrong path
11:05:16 AM [Apache] Change XAMPP Apache and Control Panel settings or
11:05:16 AM [Apache] Uninstall/disable the other service manually first
11:05:16 AM [Apache] Found Path: "C:\xampp\apache\bin\httpd.exe" -k runservice
11:05:16 AM [Apache] Expected Path: "c:\newxampp\apache\bin\httpd.exe" -k runservice
11:05:16 AM [mysql] MySQL Service detected with wrong path
11:05:16 AM [mysql] Change XAMPP MySQL and Control Panel settings or
11:05:16 AM [mysql] Uninstall/disable the other service manually first
11:05:16 AM [mysql] Found Path: C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql
11:05:16 AM [mysql] Expected Path: c:\newxampp\mysql\bin\mysqld.exe --defaults-file=c:\newxampp\mysql\bin\my.ini mysql
11:05:16 AM [mysql] Problem detected!
11:05:16 AM [mysql] Port 3306 in use by "C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql"!
11:05:16 AM [mysql] MySQL WILL NOT start without the configured ports free!
11:05:16 AM [mysql] You need to uninstall/disable/reconfigure the blocking application
11:05:16 AM [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
I want to run 2 xampp on my local server I have install one following the normal installation the other one I changed the folder name to newxampp. I have changed the ports being used by second xampp in httpd.conf as well as the mysql ports.
Questions is why the xampp apache and mysql of the second xampp is not running and getting the above error.
Reason for installing 2 xampp:
I have done projects running in 5.5 php and currently I want to learn to use zend framework but I cant install composer because it needs 5.6 php and up so I installed new xampp with 7.0. I cant just update the old xampp because I have many project using the old version and its hard to update for now
Xampp versions are :
one is v3.2.1 other is v3.2.2
You can change the port both servers
80 8080 3306 3307 if you want run servers the same time
I suggest you to use virtual hosts to manage multiple versions of PHP.
With virtual hosts you can configure your PHP version that should be used with a specific "htdocs" sub-directory.
This was already answered before here:
Is there way to use two PHP versions in XAMPP?
A workaround may be to install Apache/mysql/php separately instead of the package running a different version.
When I had wamp running I did this and Apache server for both were running.
Google how to Install separately
You can.
Just change the ports
and you can use one MySQL for both
in my case they are of different versions,
XAMPP 3.2.2 and XAMPP 3.2.1 running different versions of mySQL an PHP.
My point is the versions differences may be the reason why it works for me perhaps because of the processes names in the OS.
I have seen this question asked on multiple occasions, but many times the missing clue is not mentioned. Changing the ports is not enough.
If you rename the xampp folder to something else, you need to run <xamppdir>/setup_xampp.bat to make the new xampp dir work
Excavating long dead thread for anyone who tried to do the same, running two instances of Xampp on the same local machine.
These logs say you're trying to start services (https and mysql) but these are already installed - check your services.msc (Apache2.x and Mysql are already there and they belong to first Xampp instance, check binary paths).
You need to manually install required services and change their names at Control Panel.
Run elevated cmd, cd into second instance of your Xampp and install services manually.
For httpd, assuming it is in c:\xampp2 and new name is "Apache2.4_1"
cd \xampp2
cd apache\bin
httpd -k install -n "Apache 2.4_1"
C:\xampp2\apache\bin>httpd.exe -k install -n "Apache2.4_1"
Installing the 'Apache2.4_1' service
The 'Apache2.4_1' service is successfully installed.
Testing httpd.conf....
(my failed here due to some syntax errors generated by lack of coffee)
Next you run control panel (from secondary instance), click "config" in upper-right corner, then "service and port settings" button. In the last window input values as shown at screenshot, save. Then, change your ports in httpd* configs. Start apache, #profit.
Repeat for other services that start as services.
For clarification, I only run two httpd this way. For other services you need to find right cmdline to install service with different name as in httpd and register it in Control Panel with changed names.
You can simply delete or stop the apache service (apache2.4) from services in using run > services.msc. And then try to start apache from the xampp control panel.(In my case delete worked.)

Wrong Path of Mysql in Xampp

I am using Mysql for long time via xampp software and it is working fine. Now i installed Mysql software, While configuring Mysql software i give port 3307, to run it independently from Mysql in Xampp which is using 3306. But it is not working , I got following error when i run xampp I got screen with following error saying
MySQL Service detected with wrong path
Change XAMPP MySQL and Control Panel settings or
Uninstall/disable the other service manually first
Found Path: "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults- file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" MySQL
Expected Path: c:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql
Simple if you using windows Go to Administrative cmd and type the following command
sc delete MySQL
Try with windows command prompt with administrative mode
sc delete MySQL .
from above commands

mysql connection error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Godaddy Cpanel

My website was working fine till yesterday. But it suddenly started showing this error:
mysql connection error: Can't connect to local MySQL server through
socket '/var/lib/mysql/mysql.sock' (2)
I don't think I made any changes except adding the site to alexa. I googled this and found a lot of resources but all those couldnt help me because I did not fully understand them. I am also not able to locate the file mysql.sock.
I want to know if my website has been hacked. Plus, the solution to the problem.
Might want to start with checking all your db configuration and make sure you did not overwrite or accidentally changed something?
If not that, then try restarting your mysql server. Not sure what Linux env your running, but whichever one it is, Google how to restart mysql.
You could also try and restarting apache. I think the command for that is
sudo service apache2 reload
sudo service apache2 restart
sudo service mysql restart
Then verify if mysql is running on the socket, run this command to see the process
ps aux | grep mysql
this is simple. Run this on commandline
mysql -uroot -p -hlocalhost
sudo service mysql restart
mysql -u root -p
I hope that works.

Categories