I'm trying to reinstall mysql on my computer (os x mavericks) and I've done the following with the following errors:
bash <(curl -Ls http://git.io/eUx7rg)
Error:
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/mysql/data/christians-mbp.saumag.edu.pid).
/usr/local/mysql/support-files/mysql.server: line 362: pidof: command not found
/dev/fd/63: line 119: SORRY, MySQL IS NOT RUNNING ... THERE MUST BE A PROBLEM: command not found
So I decided to see uninstall it if it was already there:
brew uninstall mysql
bash <(curl -Ls http://git.io/eUx7rg)
This says that mysql is currently still installed, so I did the following:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*
bash<(curl -Ls http://git.io/eUx7rg)
This gave me the same error messages as before, So I decided to redo all the rm commands above, including the edit and run the following commands:
ps -ax | grep mysql
brew cleanup
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
brew doctor
brew update
brew install mysql
unset TMPDIR
mysql_install_db --verbose --user=`yyttr3` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
After the last command I got the following error message:
dyld: Library not loaded: ##HOMEBREW_PREFIX##/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/opt/mysql/bin/my_print_defaults
Reason: image not found
FATAL ERROR: Neither host 'christians-mbp.saumag.edu' nor 'localhost' could be looked up with
/usr/local/opt/mysql/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
I don't really know what the problem is, i'm not sure if i'm even installing it right. From what I have read this should be a good way to install mysql. If you have any ideas on what I would greatly appreciate it.
I'm sure you've solved this by now, but I just had the same problem. For anyone else who stumbles across this:
For me, it was an issue with OpenSSL.
resolveip `hostname`
If it says OpenSSL isn't loaded,
brew uninstall openssl
brew install openssl
then try again. Hope this helps.
I had the same problem. Only solution that I found is to install mysql from source code. The reason for this error to occur and how to solve it is explained in full detail in the following link: http://jaitechwriteups.blogspot.com.au/2010/08/mysql-installation-error-neither-host.html
All I had to do was agree XCODE terms by opening XCODE. That fixed everything.
Related
I've been searching for hours about this issue i'm having.
I have installed mysql#5.7 in my mac osx Monterey 12.0.1 with M1 chip using Homebrew.
I've been following this tutorial that helped me install mysql version 5.7. I'm specifying this version because i'm recreating a production environment on local.
At the step where I need to secure my mysql installation I type user root password and get this error Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
I have read many ways to fixing this but I can't make it work with any of those because most of them don't relate to homebrew or don't work well for me.
I have the service running using the brew services start mysql#5.7 command and this doesn't seem fixing the issue.
Is there any possibility I can't make it run because I have an M1 chip?
I researched again and remembered that I had previously installed a MySQL 8.X version. I uninstalled it only using the brew uninstall command. This wasn't enough and I made sure I deleted all the mysql related files and folders from my computer.
After that I retried installing MySQL 5.7 as a completely fresh install. Then at this same step where I had trouble before I didn't have any issue, I followed the installation and now is up and running.
These are all the files I found were related to other MySQL installations, you may or may not have them in your system but I suggest to try delete them all, here I paste the commands needed:
ps -ax | grep mysql
stop and kill any MySQL processes
brew remove mysql
brew cleanup
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
/opt/homebrew/var/mysql
/opt/homebrew/etc/my.cnf
Do you have the mysql.sock in your /tmp?
You can make a symlink, depending on your installation
ln -s /var/mysql/mysql.sock /tmp/mysql.sock
Problem:
Getting Cannot load from mysql.procs_priv. The table is probably corrupted when trying to create new mysql user.
Platform: OSX Yosemite, Homebrew
Tried all the below and DID NOT WORK:
Upgrading: mysql_upgrade -uroot -p
I had to use --force because of this: This installation of MySQL is already upgraded to 5.7.9, use --force if you still need to run mysql_upgrade
Next I had to use --skip-version-check because of this: Error: Server version (5.7.18) does not match with the version of the server (5.7.9) with which this program was built/distributed. You can use --skip-version-check to skip this check.
still didn't work after all that
Reducing the query to most obvious and taking out functions: CREATE USER 'newuser';, still throws same error.
Repairing the mysql.procs_priv table
Changing all the char columns in mysql.procs_priv to varchar, as suggested here. Well he suggested changing to text but that seemed too crazy for a core mysql table.
I think it will be better to use this:
mysql_upgrade -u root -p
Enter your password and wait a few seconds.
Completely removing mysql and reinstalling it worked (less than 15 mins).
1. UNINSTALL AND PURGE MYSQL FROM SYSTEM
Back up databases.
Stop and kill any MySQL processes. Check for processes with ps -ax | grep mysql
Uninstall mysql
brew remove mysql
brew cleanup
Remove all the residual files
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
Unload previous auto login
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Remove previous config. Delete the line MYSQLCOM=-YES- from /etc/hostconfig
Remove previous preferences
sudo rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
sudo rm -rf /private/var/db/receipts/*mysql*
sudo rm -rf /private/var/mysql
Optional, restart computer. I didn't.
2. INSTALL MYSQL
Install Mysql
brew install mysql
Set to run on startup
brew services start mysql
Secure the installation
mysql_secure_installation
I am new in Ubuntu, I installed XAMPP in my Ubuntu 10.04. When I start XAMPP it says MySQL couldn't start.
Here is my terminal ouput:
$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 1.8.0...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Couldn't start MySQL!
XAMPP: Starting ProFTPD...
XAMPP for Linux started.
And then as I go to http://localhost, I got stuck on the XAMPP splash-screen, nothing happens if I choose language.
This Worked For me as a Charm. [I used Ubuntu 12.04 and Xampp]
sudo chmod 755 /opt/lampp/etc/my.cnf
sudo chmod -R 777 /opt/lampp/var/mysql
sudo chown -hR root:root /opt/lampp
& Now Start Your Xampp
It might just be that the /opt/lampp doesn't have the right permissions. Before reinstalling everything, try running the commands below, it worked for me:
sudo /opt/lampp/lampp stop
sudo chmod 755 /opt/lampp/etc/my.cnf
sudo chmod -R 777 /opt/lampp/var/mysql
sudo chown -hR root:root /opt/lampp
sudo /opt/lampp/lampp start
Just remove the version where the MySQL is not started with the command rm -rf /opt/lampp
and the command:
tar xvfz xampp-linux-1.8.1.tar.gz -C /opt
Replace xampp-linux-1.8.1.tar.gz with your file name. After restarting your lampp, it will work fine.
You may not have completely removed your old lampp instance. Please remove it and install lampp once again.
It might be the right permissions problem. Some solutions guide you to set it to 777 which is not recommended. Try to set it to original permissions as installed. (especially after you restore from a tar without preserving the permissions)
sudo /opt/lampp/lampp stop
sudo chown nobody.root /opt/lampp/var/mysql/cdcol /opt/lampp/var/mysql/mysql /opt/lampp/var/mysql/phpmyadmin -R
sudo chown nobody.nogroup /opt/lampp/var/mysql/yourdbname -R
sudo /opt/lampp/lampp start
Even I had the same issue. Always check for the error log before proceeding to find the root cause. Sometimes it could be file system space issue. In my case it was "/" file system was full. After clearing some space I was able to start the services without issues.
Thanks,
Vishnu
XAMPP started successfully on my side, but still got stuck at spalsh screen.
It was solved by giving permission to lang.tmp file
sudo chmod 777 /opt/lampp/htdocs/xampp/lang.tmp
Your previous MySQL installation might be blocking your MySQL from the xampp bundle. I also had the same problem. Just uninstall the previous MySQL. Open the terminal(Ctrl ALt T) and paste the following code:
First stop XAMPP:
sudo /opt/lampp/lampp stop
Uninstall MySQL:
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
Start XAMPP:
sudo /opt/lampp/lampp start
I found the answer. First completly uninstall the lampp and then reinstall it. Before uninstalling, stop the lampp using the command:
/opt/lampp/lampp stop
and then uninstall/remove it using the command
rm -rf /opt/lampp
then reinstall it.
I need to install older version of mysql server on mac os, but I have a newer version.
I tried to remove this newer installation (5.1), but when start old version install (5.0b) message "MySQL 5.0.51b-community for Mac OS X can't be installed in this disk. A newer version of this software alrady exists on this disk".
I can't recognize problem, because I remove all data of previouse install, but installer says no.
Mac OS version 10.6.
Try running also
sudo rm -rf /var/db/receipts/com.mysql.*
Try this, I had to struggle but this works for me!!!!!!!
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
(Edit /etc/hostconfig) sudo vi /etc/hostconfig (Remove line MYSQLCOM=-YES)
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*
Test finding all files and folders with "mysql" in their name, take a look at them and see if they must be deleted as well.
Use the following command to find all the files.
sudo find / | grep -i mysql
You can scroll through the output if you put | less at the end (it won't show anything up until it finds something, just so you wouldn't think the command failed.) :-) You can write it as follows.
sudo find / | grep -i mysql | less
To remove the files/folders, you will have to run the following command (-f means force so you won't be able to restore the files and you won't be asked for a confirmation before they are deleted):
sudo rm -rf /path/to/file/or/folder
Hope this will be of any help.
I believe you can essentially just delete the /usr/local/mysql-Version/ and unlink the /usr/local/mysql directory. Getting rid of the system pref and the start up item might be harder, but I didn't install those so I can't help there.
You can use the built-in utility pkgutil to remove the package receipt:
sudo pkgutil --forget com.mysql.mysql
On Snow Leopard I had to additionally kill mysqld and did
rm /private/var/db/receipts/com.mysql.*
sudo rm -rf /Users//Library/StartupItems/MySQLCOM
sudo rm -rf /Users//Library/PreferencePanes/My*
sudo rm -rf /Users//Library/Receipts/mysql*
sudo rm -rf /Users//Library/Receipts/MySQL*
I accidentally installed the PowerPC version of MySQL on my Intel Mac in Snow Leopard, and it installed without a problem but of course doesn't run properly. I just didn't pay enough attention. Now when I try to install the correct x86 version it says that it can't install because a newer version is already installed. A Google query led me to perform these actions/delete these files to uninstall it:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySQL*
rm -rf ~/Library/PreferencePanes/MySQL*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
And finally removed the line MYSQLCOM=-YES- from /etc/hostconfig
They haven't seemed to help at all. I am still receiving the same message about there being a newer version. I tried installing an even newer version (the current Beta) and it also gave me the same message about a newer version already being installed. I can't uninstall it from the Prefs Pane because I never installed the PrefPane also.
Try running also
sudo rm -rf /var/db/receipts/com.mysql.*
I also had entries in:
/Library/Receipts/InstallHistory.plist
that i had to delete.
If you installed mysql through brew then we can use command to uninstall mysql.
$ brew uninstall mysql
Uninstalling /usr/local/Cellar/mysql/5.6.19...
This worked for me.
ps -ax | grep mysql
*stop and kill any MySQL processes
brew remove mysql
brew cleanup
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/MySql*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
*restart your computer just to ensure any MySQL processes are killed
try to run mysql, it shouldn't work
OS version: 10.14.6
MYSQL version: 8.0.14
Goto System preferences -> MYSQL
Stop MySQL server
One option will be shown here to uninstall MYSQL 8 after stopping Mysql server
Aside from the long list of remove commands in your question, which seems quite comprehensive in my recent experience of exactly this issue, I found mysql.sock running in /private/var and removed that. I used
find / -name mysql -print 2> /dev/null
...to find anything that looked like a mysql directory or file and removed most of what came up (aside from Perl/Python access modules). You may also need to check that the daemon is not still running using Activity Monitor (or at the command line using ps -A). I found that mysqld was still running even after deleting the files.
I also had a config file at /etc/my.cnf that I needed to delete on my Mac OS X Snow Leopard install
It might be overkill but your MySQL command history can also be wiped from:
~/.mysql_history
You need to identify where MySQL was installed to before attempting to delete it.
I always use the Hivelogic guide to installing under Mac OS X which builds MySQL from source. When setting up the build you can specify a directory under which to install MySQL with the --prefix parameter. You should make sure the directory does not exist and attempt to install from source.
./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
--enable-thread-safe-client --enable-local-infile --enable-shared \
--with-plugins=innobase
You should also check /var/db/receipts and remove all entries that contain com.mysql.*
Using sudo rm -rf /var/db/receipts/com.mysql.* didn't work for me. I had to go into var/db/receipts and delete each one seperately.
For me, I had installed MariaDB years ago using homebrew. Correct uninstall procedure was:
brew uninstall mariadb.
I also found
/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
after using all of the other answers here to uninstall MySQL Community Server 8.0.15 from OS X 10.10.
This did the job for me:
brew uninstall mysql
brew uninstall --force mysql#<version_no>
exmample
brew uninstall --force mysql#5.7
to get version check cd /usr/local/Cellar
Remove MySQL completely
Open the Terminal
Use mysqldump to backup your databases
Check for MySQL processes with:
ps -ax | grep mysql
Stop and kill any MySQL processes
Analyze MySQL on HomeBrew:
brew remove mysql
brew cleanup
Remove files:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
Unload previous MySQL Auto-Login:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Remove previous MySQL Configuration:
subl /etc/hostconfig`
# Remove the line MYSQLCOM=-YES-
Remove previous MySQL Preferences:
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
Restart your computer just to ensure any MySQL processes are killed
Try to run mysql, it shouldn't work
sudo find / | grep -i mysql
This worked like a charm for me. Just went through the list and ensured that anything MySQL related was deleted.