服务器Centos部署MySql,实现Navicat连接

(1)服务器配置:

[root@localhost ~]# cd /usr/local/src/

[root@localhost src]# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm 

[root@localhost src]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm 

"""
mysql-community-client-5.7.30-1.el7.x86_64.rpm      
mysql-community-server-5.7.31-1.el7.x86_64.rpm
"""
将这两个个rpm包,以FTP形式导入:/var/cache/yum/x86_64/7/mysql57-community/packages/


[root@localhost src]#  yum -y install mysql-server

等待时间较长

(2)重置密码与创建用户

#重启mysql服务
[root@VM-0-3-centos src]# service mysqld restart

#重置密码
[root@localhost ~]# grep "password" /var/log/mysqld.log

服务器Centos部署MySql,实现Navicat连接

 

 

#密码重置
mysql> alter user root@localhost identified by password;//密码重置,新的密码 Query OK, 0 rows affected (0.00 sec) #创建新的用户, mysql> create user username@% identified by paswword;//添加新的用户,密码 Query OK, 0 rows affected (0.00 sec)

#给新用户分权限
mysql> grant all privileges on *.* to ‘user1‘@‘%‘ with grant option;

  Query OK, 0 rows affected (0.00 sec)

   #刷新权限  

   mysql> flush privileges;

   Query OK, 0 rows affected (0.00 sec)

(3)查询MySql当前用户:

mysql> select user,host from mysql.user;
+---------------+-----------+
| user          | host      |
+---------------+-----------+
| user1         | %         |
| mysql.session | localhost |
| mysql.sys     | localhost |
| root          | localhost |
+---------------+-----------+
4 rows in set (0.00 sec)

mysql> 

 

(4)实现在Navicat上连接

【常规】端配置参数

服务器Centos部署MySql,实现Navicat连接

【SSH】端配置参数

服务器Centos部署MySql,实现Navicat连接

服务器Centos部署MySql,实现Navicat连接

上一篇:CentOS7下安装mysql5.7及mysql登录错误


下一篇:JAVA的SPI机制-案例-JDBC