Mac下安装与配置MySQL
步骤:
1、官网下载mysql安装包mysql-5.7.13-osx10.11-x86_64.bmg安装
2、安装完成后终端输入:
mysql --version
----显示版本号说明正常,若显示command not found,在终端输入如下,”/usr/local/mysql/bin/mysql”为mysql默认安装路径:
$ cd /usr/local/bin/
$ sudo ln -fs /usr/local/mysql/bin/mysql mysql
3、关闭mysql服务:
sudo /usr/local/mysql/support-files/mysql.server stop
4、配置root账号的密码,默认没有配置,
-----在终端内输入(开启安全模式启动mysql):
sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
-----修改密码,终端输入(逐行输入,必须,“****“为设置的密码):
mysql -u root UPDATE mysql.user SET authentication_string=PASSWORD('*****') WHERE User='root'; FLUSH PRIVILEGES; \q
5、配置完成后验证,在终端输入:
mysql -u root -p
----提示输入密码,进入mysql说明成功!
mysql>
6、mysql服务启动和关闭可以在系统偏好设置里面操作,终端命令如下:
$ sudo /usr/local/mysql/support-files/mysql.server start $ sudo /usr/local/mysql/support-files/mysql.server stop
相关推荐
lpfvip00 2020-10-07
flyToSkyL 2020-09-11
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11