【Mac + Mysql + Navicat Premium】之Navicat Premium如何连接Mysql数据库
参考文章:
因为我需要连接数据库工具,需要密码,所以下面介绍如何设置、修改密码实现Navicat Premium连接Mysql数据库
建议生产环境中mysql安装这完成后一定要运行一次mysql_secure_installation,在这里可以第一次设置密码,后续修改密码规则时可以多次修改密码,见下面:二、修改密码规则以及多次修改密码(但是,如果设置密码太简单低级会遇到密码策略问题,参考文章)
一、安全配置设置初始密码
启动mysql
mysql.server start
设置密码:
mysql_secure_installation
运行mysql_secure_installation会执行几个设置:
a)为root用户设置密码
b)删除匿名账号
c)取消root用户远程登录
d)删除test库和对test库的访问权限
e)刷新授权表使修改生效
代码如下:
Securing the MySQL server deployment. Connecting to MySQL using a blank password. VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component? Press y|Y for Yes, any other key for No: y ==》输入y There are three levels of password validation policy: LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0 ==》选择高中低密码,我选的0低级
Please set the password for root here. New password: ==》输入新密码 Re-enter new password: ==》再次输入新密码 Estimated strength of the password: 50
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y ==》安全只有50,输入y Password updated successfully! Reloading privilege tables.. … Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n]<– 是否删除匿名用户,生产环境建议删除,所以直接回车 … Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n]<–是否禁止root远程登录,根据自己的需求选择Y/n并回车,建议禁止 … Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n]<– 是否删除test数据库,直接回车 - Dropping test database… … Success! - Removing privileges on test database… … Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n]<– 是否重新加载权限表,直接回车 … Success! Cleaning up… All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL! [root@server1 ~]#
初始密码设置成功,验证一下,登陆mysql:
#登陆mysql
mysql -u root -p 输入密码:xxxx
能进入就成功了!!!
二、修改密码规则以及可以多次修改密码
再返回到Navicat Premium中,


2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(../Frameworks/caching_sha2_password.so, 2): image not found
解决上面问题参考:《Navicat连接数据库MySQL报错2059》
是密码规则问题,解决问题如下:
#登陆mysql
mysql -u root -p #输入密码
Enter password: xxx #修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #更新一下用户的密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; #刷新权限
FLUSH PRIVILEGES;
效果图:

但是,重新连接Navicat Premium时,还是报错

1045 - Access denied for user 'root'@'localhost' (using password: YES)
是因为,我上一步在更新密码中又把密码设置为“password”了,所以重新输入密码,再连接

【Mac + Mysql + Navicat Premium】之Navicat Premium如何连接Mysql数据库的更多相关文章
- 在64位Win7中使用Navicat Premium 和PL\SQL Developer连接Oracle数据库备忘
最近接手了一个项目,服务器端数据库是oracle 11g 64位.由于主要工作不是开发,也不想在自己的电脑上安装庞大的oracle数据库,因此寻思着只通过数据库管理工具连接数据库进行一些常用的查询操作 ...
- MySQL学习之路1-Mac下启动连接MySQL服务
MySQL简介 (MySQL是目前最流行的关系型数据库管理系统,现属于Oracle公司.) MySQL主要特点: 支持大型数据库,支持5000万条记录的数据仓库,32位系统表文件最大可支持4GB,64 ...
- 【MySql】权限不足导致的无法连接到数据库以及权限的授予和撤销
[环境参数] 1.Host OS:Win7 64bit 2.Host IP:192.168.10.1 3.VM: VMware 11.1.0 4.Client OS:CentOS 6 5.Client ...
- 2013 - lost connection to mysql server at 'reading initial communication packet' 连接mysql报错
早上刚到公司,启动项目发现连接池初始化报错,于是我打开本地mysql管理工具,测试是否可以连接.报错2013代码: 现已解决. 重启服务器mysql服务就好. 因为我连接的是本地windows系统,所 ...
- 使用Navicat Premium连接mysql数据库
Navicat Premium是一个可多重连接的数据库管理工 具,它可让你以单一程序同时连接. Navicat Premium 使你能简单并快速地在各种数据库系统间传输数据,或传输一份指定 SQL 格 ...
- 使用Navicat Premium 和PL\SQL Developer连接Oracl
在64位Win7中使用Navicat Premium 和PL\SQL Developer连接Oracle数据库备忘 最近接手了一个项目,服务器端数据库是oracle 11g 64位.由于主要工作不 ...
- 在Mac OS X中配置Apache + PHP + MySQL 很详细
这是一篇超级详细的配置mac os下面php+mysql+apache的文章.非常详细我的大部分配置就是参考上面的内容的,比如,PHP不能连接数据库,就是改一下默认的php.ini中pdo_mysql ...
- Navicat无法连接SqlServer数据库
一.起因 原来安装过SqlServer 2008 R2,后来不用卸载了(没清理,单卸载),之后一直通过Navicat远程连接服务器的SqlServer使用. 前两天工作需要,又安装了SqlServer ...
- 在Mac OS X中配置Apache + PHP + MySQL
在Mac OS X中配置Apache + PHP + MySQL Mac OS X 内置Apache 和 PHP,使用起来非常方便.本文以Mac OS X 10.6.3和为例.主要内容包括: 启动Ap ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统(91)-EF 连接 MySql
前言 虽然系统目前只支持MSSQL版本,但是很多朋友公司技术规定必须使用MySql,下面我们就来使用EF连接MySQL吧! (1)安装MYSQL环境 1.下载安装MYSQL数据,这里我们安装phpSt ...
随机推荐
- 记录在Spring-Boot中使用Fegin调用RESTfull的PATCH方法设置
使用了ZooKeeper,设置 spring.cloud.zookeeper.dependency.headers.enabled=false 参考: https://github.com/sprin ...
- MSSQL收缩事务日志&日志文件过大无法收缩
原文:MSSQL收缩事务日志&日志文件过大无法收缩 一.MS SQL SERVER 2005 --1.清空日志 exec('DUMP TRANSACTION 数据库名 WITH NO_LOG' ...
- 慎用SELECT INTO复制表
原文:慎用SELECT INTO复制表 很多时候我们习惯于用SELECT INTO复制一个表或表结构,因为它方便,快捷,而且在某些情况下效率比INSERT INTO 效率要高一些.但是要注意: SEL ...
- 【IntellJ IDEA】idea启动测试类报错Error running 'Test1.test': Command line is too long. Shorten command line for Test1.test or also for JUnit default configuration.
idea启动测试类报错 Error running 'Test1.test': Command line is too long. Shorten command line for Test1.tes ...
- ubuntu16.04 ssh服无法远程连接解决办法
1.安装ssh服务sudo apt-get install openssh-server 2.修改配置文件sudo vi /etc/ssh/sshd_config#PermitRootLogin wi ...
- 面试题:Add Two Numbers(模拟单链表)
题干: You are given two non-empty linked lists representing two non-negative integers. The digits are ...
- ES6中的迭代器(Iterator)和生成器(Generator)(一)
用循环语句迭代数据时,必须要初始化一个变量来记录每一次迭代在数据集合中的位置,而在许多编程语言中,已经开始通过程序化的方式用迭代器对象返回迭代过程中集合的每一个元素 迭代器的使用可以极大地简化数据操作 ...
- 又见The request sent by the client was syntactically incorrect ()
前几天遇到过这个问题(Ref:http://www.cnblogs.com/xiandedanteng/p/4168609.html),问题在页面的组件name和和注解的@param名匹配不对,这个好 ...
- dev_queue_xmit()函数返回值问题
函数 dev_queue_xmit()用于直接使用sk_buf发包,此函数有返回值,但是并不能通过 此函数返回值为0来说明包已经发送出去且可以立刻释放sk_buff内存.因为网卡发包是一个异步的过程 ...
- TELNET模拟HTTP请求
开启nginx服务,查看服务器地址(192.168.11.119) 使用telnet命令连接服务器的80端口 http协议报文格式 1.request 2.response 输入请求行: GET / ...