Although if have written some commands in terminal like this:
sudo killall mysql
sudo chmod -Rf 777 /Applications/XAMPP/xamppfiles/var/mysql/
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Related
I installed MySQL 5.7.24 via Homebrew on MacOS Mojave v 10.14.4 per this gist. Now, I'm trying to remove it, but can't.
When I run brew remove mysql I get Error: No available formula or cask with the name "mysql".
I can run brew uninstall --force mysql and follow all the instructions from the post linked below, but I can't get brew remove mysql to work.
How to uninstall MySQL 5.6 when installed by brew on macOS?
Here are the steps I'm following:
# stop mysql
brew services stop mysql#5.7
# force uninstall
brew uninstall --force mysql
# check for running instances
ps -ax | grep mysql | grep -v grep
# no running process to kill
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
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 computer
After all of this, when I run mysql --version I get mysql Ver 14.14 Distrib 5.7.24, for osx10.9.
Also, I thought that maybe I needed to specify mysql#5.7 instead of just mysql, but I still get the same error.
It works with the version number.
brew uninstall --force mysql#5.7
screenshotstrong text
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 have just installed mariadb 10.1.21 latest with brew.
here is what i got with command
> mysql.server start
or
/usr/local/Cellar/mariadb/10.1.21/support-files/mysql.server start
whatever.
Starting MySQL
.170225 03:41:19 mysqld_safe Logging to '/usr/local/var/mysql/mac-615.err'.
170225 03:41:19 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
ERROR!
I do not know any reason why I cannot even start mysql daemon.
I had the same problem today. What I did was just uninstalling both mariaDB and mysql.
Remember doing a backup of your DB's in case you need it.
Just run the following commands in you terminal:
For mysql:
brew remove mysql
For mariaDB:
brew remove mariadb
Then, remove mysql folders and 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*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
vi /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*
Maybe, most of the folders and files won't exist, just to be sure they won't mess with the installation, do it.
After you have removed mysql and mariaDB files, run
brew cleanup
to ensure cache is gone.
Once it's done, you should be able to do a clean installation of mariadb with
brew install mariadb
Try your installation by running
mysql.server start
If hangs at starting, try restarting mysql with
mysql.server restart -f
By doing this, I was able to run mariadb, I hope it works for you.
First of all let me start by saying that I have read and tried all approaches that I found on the web and stack overflow.
What I get when I try to run
mysql.server start
or
sudo /usr/local/mysql/support-files/mysql.server start
is
ERROR! The server quit without updating PID file (/usr/local/var/mysql/hostname.local.pid).
What I get when I try to run:
mysql
is
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I also tried:
sudo mysqld_safe &
Clicking the mysql start button on system preferences.
Restart the computer
Reinstall mysql
Install older version of mysql
killall and then try to run mysql
sudo chmod -R 777 /usr/local/mysql/
`sudo chown -R mysql /var/lib/mysql/
rm /usr/local/var/mysql/localhost.err
sudo /usr/local/mysql/bin/mysqld_safe start
tried everything here: How to auto-load MySQL on startup on OS X Yosemite / El Capitan
I am out of ideas, I don't know what to do.
What I did to actually make it work:
killall -u username
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
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 the computer
brew doctor and fix any errors
brew update
brew install mysql
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start
I have been downloaded the DEB package of mysql 5.5.23.
Install MySQL by the command as follows:
sudo dpkg -i mysql-5.5.23-debian6.0-x86_64.deb
The result said that installed successfully.
But when I type the command:
sudo service mysql start
Or
mysql
It shows me that "mysql: unrecognized service" or "mysql: command not found".
Besides, I can't find MySQL files in "/usr/include" or "/usr/bin"
Please help me. Thx.
Because MySQL 5.5.x is not packaged, in repositories only exist 5.1.x
This worked for me:
http://www.rebojo.com/debian-installing-mysql/
Why not a simple command :
sudo apt-get install mysql-server
MySQL Download URL
https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
Open the terminal and follow along:
Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
Delete the MySQL profile
sudo rm /etc/mysql/ -R
Automatically uninstall mysql
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor
Download version 5.5.51 from MySQL site
wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
Add mysql user group
sudo groupadd mysql
Add mysql (not the current user) to mysql user group
sudo useradd -g mysql mysql
Extract it
sudo tar -xvf mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
Move it to /usr/local
sudo mv mysql-5.5.56-linux-glibc2.5-x86_64 /usr/local/
Create mysql folder in /usr/local by moving the untarred folder
cd /usr/local
sudo mv mysql-5.5.49-linux2.6-x86_64 mysql
set MySql directory owner and user group
cd mysql
sudo chown -R mysql:mysql *
Install the required lib package (works with 5.6 as well)
sudo apt-get install libaio1
Execute mysql installation script
sudo scripts/mysql_install_db --user=mysql
Set mysql directory owner from outside the mysql directory
sudo chown -R root .
Set data directory owner from inside mysql directory
sudo chown -R mysql data
Copy the mysql configuration file
sudo cp support-files/my-medium.cnf /etc/my.cnf
Start mysql
sudo bin/mysqld_safe --user=mysql &
sudo cp support-files/mysql.server /etc/init.d/mysql.server
Set root user password
sudo bin/mysqladmin -u root password '[your new password]'
Add mysql path to the system
sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
Reboot!
Start mysql server
sudo /etc/init.d/mysql.server start
Stop mysql server
sudo /etc/init.d/mysql.server stop
Check status of mysql
sudo /etc/init.d/mysql.server status
Enable myql on startup
sudo update-rc.d -f mysql.server defaults
*Disable mysql on startup (Optional)
`sudo update-rc.d -f mysql.server remove`
REBOOT!
Now login using below command, start mysql server if it's not running already
mysql -u root -p