[
Mac 关于Mysql的卸载:
如使⽤brew安装:brew uninstall MySQL 或者 brew remove mysql
但是⼜有点怕某些东西没有卸载完全影响到下⼀次的安装(我第⼀次重装就是这样的)以下是完整⼀点的⼿动卸载:
sudo rm /usr/local/mysql sudo rm -rf /usr/local/mysql* sudo rm -rf /Library/StartupItems/MySQLCOM sudo rm -rf /Library/PreferencePanes/My* rm -rf
~/Library/PreferencePanes/My* sudo rm -rf /Library/Receipts/mysql* sudo rm -rf /Library/Receipts/MySQL* sudo rm -rf /var/db/sql.* 其实不同的安装⽅式有些东西的存储位置不⼀样,删除完检查⼀下⼀些问⽂件是否删除了,没有的话则删除掉: /usr/local/Cellar ⾥的mysql⽂件 /usr/local/var ⾥的mysql⽂件 /tmp ⾥的mysql.sock, mysql.sock.lock, myf⽂件 pid⽂件和err⽂件都在/usr/local/var/mysql⾥确保删除了 brew安装的安装包存储在/usr/local/Library/Cache/Homebrew也可以⼀并删除执⾏brew cleanup
错误⼀:Error: The brew link step did not complete successfully
在brew执⾏install mysql之后会出现⼀系列的安装信息,出现⼀个Error,查看到了ERROR的内容:
Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink lib/libmysqlclient.20.dylib /usr/local/lib is not writable. You can try again using: brew link mysql
~ brew link mysql
Linking /usr/local/Cellar/mysql/5.
Error: Could not symlink lib/libmysqlclient.20.dylib
mysql需要安装documentation/usr/local/lib is not writable. //这个⽂件夹不可写
sudo chown -R $(whoami) /usr/local/lib/ Password: ➜ ~ brew link mysql Linking /usr/local/Cellar/mysql/5.7.12… 93 symlinks created
错误⼆:Can\’t open the mysql.plugin table.
ERROR! The server quit without updating PID file (/usr/local/var/mysql/xxxiMac.local.pid). mysqld: Tabl
e 'mysql.plugin' doesn't exist [ERROR] Can\'t open the mysql.plugin table. Please run mysql_upgrade to create it. 解决⽅法: unset TMPDIR mysql_install_db --verbose --user=mysql --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql
/etc/myf 配置⽂件信息
[mysqld_safe] log-error = /usr/local/var/mysql/logs/error.log [mysqld] datadir = /usr/local/var/mysql bind-address = 127.0.0.1 port = 3306 [client] socket =
/tmp/mysql.sock
错误三:ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
⽅案⼀: jddeiMac:~ iosTest$ mysql.server stop Shutting down MySQL .. SUCCESS! jddeiMac:~ iosTest$ mysql.server start --skip-grant-tables Starting MySQL . SUCCESS! jddeiMac:~ iosTest$ mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.17 Homebrew ⽅案⼆: jddeiMac:tmp iosTest$ mysqld --skip-grant-tables & [1] 18745 jddeiMac:tmp iosTest$ 2017-03-29T10:04:00.209544Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp
server option (see documentation for more details). 2017-03-29T10:04:00.209815Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2017-03-29T10:04:00.209889Z 0 [Note] mysqld (mysqld 5.7.17) starting as process 18745 ...

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。