(1)服务器配置: [root@localhost ~]# cd /usr/local/src/ [root@localhost src]# wget Http://repo.Mysql.com/mysql57
(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
#密码重置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上连接
【常规】端配置参数
【ssh】端配置参数
--结束END--
本文标题: 服务器Centos部署MySql并连接Navicat过程详解
本文链接: https://lsjlt.com/news/9655.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0