欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

服务器Centos部署MySql并连接Navicat过程详解

程序员文章站 2022-09-06 10:13:36
(1)服务器配置:[root@localhost ~]# cd /usr/local/src/[root@localhost src]# wget http://repo.mysql.com/mysq...

(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)

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过程详解

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。