Home > Database > Mysql Tutorial > body text

Mac 安装和卸载 Mysql5.7.11 的方法_MySQL

PHP中文网
Release: 2017-04-05 09:27:25
Original
1816 people have browsed it

Mac 安装和卸载 Mysql5.7.11 的方法_MySQL

安装

去http://www.mysql.com/downloads/, 选择最下方的MySQL Community Edition,点击MySQL Community Server的download, 下载DGM Archive版本。

下载好之后发现只有一个dmg主文件,貌似5.7之前的版本会有多个安装文件。

点开这个文件,逐步安装,注意在成功的时候会弹出提示框,给出临时密码,一定要记住,一定要记住,一定要记住!!!! 如果没找到,请桌面右拉看notifications。

安装成功后,到偏好设置最后一行找到mysql,启动mysql(选择start).

下面就好进行临时密码的修改了:

打开terminal, 一般mysql会默认存在local目录下,所以输入

cd /usr/local/mysql/bin/

执行以下命令:

./mysqladmin –u root –p password
Copy after login

然后会提示输入密码,输入你的临时密码,成功之后会要求输入新密码,将会出现的代码如下

New password:
Confirm new password:
Copy after login

然后出现Since password will be sent to server in plain text, use ssl connection to ensure password safety.这代表已经修改成功啦。

然后使用新的密码登陆mysql,

cd /usr/local/mysql/bin/ 
./mysqladmin –u root –p
Copy after login

然后输入新密码就好啦!

卸载!!!

在安装过程中出现各种各样的问题,导致我多次重复安装,最终一团糟。后来知道安装新的需要把之前的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/receipts/com.mysql.
调用vim /etc/hostconfig,删除 MYSQLCOM=-YES-这一行。
Copy after login

Tips: 我貌似没有删干净,所以在finder-Go-gotofolder之下输入/usr/local,看有没有重复的mysql文件,有的话就彻底删除。

对了,下载完之后local里面会有一个带有你下载的版本名字的mysql文件夹和一个Mysql快捷方式,我们都是调用这个快捷方式的。

以上就是Mac 安装和卸载 Mysql5.7.11 的方法_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!