Mac版本下的Mysql、Navicat安装及配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/BigBingtang/article/details/82997522

1、下载安装:

mysql:https://dev.mysql.com/downloads/mysql/  

选择不登录,直接下载即可

安装:下一步下一步即可,最后选择安全性强的密码设置,设置一个至少八位的密码

然后在系统偏好里开启

配置环境变量:

-打开终端,

ls -a查看全部文件,

open .bash_profile  编辑文件(若不存在就先新建一个 touch .bash_profile)

在文本中添加export PATH=${PATH}:/usr/local/mysql/bin    ,保存

让 .bash_profile 配置文件立即生效:source ~/.bash_profile

navicat:百度地址

我下载的试用,以后网上找对应版本的注册码使用即可。

2.使用:

打开navicat,connection-mysql-输入连接名、密码,ok。首次使用若提示重置密码,按提示操作即可

新建数据库:new database-

运行sql文件:在对应的数据库上,执行execute sql file-选择对应的sql文件-start-执行完成后close-refresh刷新表

3.遇到问题:

#navicat链接数据库时出错#

输入密码后提示:

Client does not support authentication protocol requested by server; consider upgrading MySQL client

终端输入也提示错误

$ sudo ./mysql

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

$ mysqld -install

-bash: mysqld: command not found

$ sudo ./mysqld -install

2018-10-10T05:27:29.522288Z 0 [System] [MY-010116] [Server] /usr/local/mysql-8.0.12-macos10.13-x86_64/bin/mysqld (mysqld 8.0.12) starting as process 3193

2018-10-10T05:27:29.525119Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/mysql-8.0.12-macos10.13-x86_64/data/ is case insensitive

2018-10-10T05:27:29.525198Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

2018-10-10T05:27:29.525222Z 0 [ERROR] [MY-010119] [Server] Aborting

2018-10-10T05:27:29.525369Z 0 [System] [MY-010910] [Server] /usr/local/mysql-8.0.12-macos10.13-x86_64/bin/mysqld: Shutdown complete (mysqld 8.0.12)  MySQL Community Server - GPL.

解决办法:

打开cmd:

cd /usr/local/mysql/bin/

mysql -u root -p

输入安装时设置的密码,启动成功,进入到了mysql的终端

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.03 sec)

mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的八位以上密码';

Query OK, 0 rows affected (0.06 sec)

mysql> SELECT plugin FROM mysql.user WHERE User = 'root';

再次连接navicat,输入设置的密码。连接成功

猜你喜欢

转载自blog.csdn.net/BigBingtang/article/details/82997522