在centos 7下安装mysql 5.7.17
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了在centos 7下安装mysql 5.7.17,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4632字,纯文字阅读大概需要7分钟。
内容图文
mysql [root@VM_167_102_centos ~]#结果发现没有,那么我们先下载mysql得rpm包
首先下载server
[root@VM_167_102_centos mysql]# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-server-5.7.17-1.el7.x86_64.rpm --2017-04-02 17:51:11-- https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-server-5.7.17-1.el7.x86_64.rpm Resolving cdn.mysql.com (cdn.mysql.com)... 23.219.134.205 Connecting to cdn.mysql.com (cdn.mysql.com)|23.219.134.205|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 169496800 (162M) [application/x-redhat-package-manager] Saving to: ‘mysql-community-server-5.7.17-1.el7.x86_64.rpm‘ 0% [ ] 593,988 65.3KB/s eta 42m 14s
然后下载client
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-client-5.7.17-1.el7.x86_64.rpm --2017-04-02 17:55:12-- https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-client-5.7.17-1.el7.x86_64.rpm Resolving cdn.mysql.com (cdn.mysql.com)... 23.211.97.88 Connecting to cdn.mysql.com (cdn.mysql.com)|23.211.97.88|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 25037548 (24M) [application/x-redhat-package-manager] Saving to: ‘mysql-community-client-5.7.17-1.el7.x86_64.rpm‘ 7% [=======> ] 1,762,140 60.9KB/s eta 3m 50s
然后先安装server
[root@VM_167_102_centos mysql]# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm --nodeps --force warning: mysql-community-server-5.7.17-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-server-5.7.17-1.e################################# [100%]
然后安装client
[root@VM_167_102_centos mysql]# rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm --nodeps warning: mysql-community-client-5.7.17-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-client-5.7.17-1.e################################# [100%]
然后启动mysql服务
[root@VM_167_102_centos mysql]# service mysqld start Redirecting to /bin/systemctl start mysqld.service [root@VM_167_102_centos mysql]#
获取临时密码
[root@VM_167_102_centos mysql]# grep ‘temporary password‘ /var/log/mysqld.log 2017-04-02T14:55:58.589047Z 1 [Note] A temporary password is generated for root@localhost: k1pki)rKa6HL
然后使用临时密码进入mysql修改密码
[root@VM_167_102_centos mysql]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.17 Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql>
然后进入etc/my.cnf在[mysqld]下添加一行如下代码
skip-grant-tables
然后在使用刚才得临时密码进入mysql修改root密码
mysql> update mysql.user set authentication_string=password(‘root‘) where user=‘root‘ and Host = ‘localhost‘; Query OK, 1 row affected, 1 warning (0.00 sec)
然后再把my.cnf文件下刚刚添加得那行代码删除
然后重启mysql
[root@VM_167_102_centos /]# service mysqld restart Redirecting to /bin/systemctl restart mysqld.service [root@VM_167_102_centos /]#
然后就可以使用刚才设置得密码进入mysql了
[root@VM_167_102_centos /]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.17 Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql>
设置开机自动重启
[root@VM_167_102_centos /]# systemctl enable mysqld
[root@VM_167_102_centos /]# systemctl daemon-reload
为了确保远程能访问还得增加3306端口开放
这样centos7_64位安装mysql5.7.17就搞定啦。
不对得地方请各位大佬指正
在centos 7下安装mysql 5.7.17
标签:cte rate gis mysql修改密码 start and class 服务 ora
本文系统来源:http://www.cnblogs.com/gbwpyq/p/6660304.html
内容总结
以上是互联网集市为您收集整理的在centos 7下安装mysql 5.7.17全部内容,希望文章能够帮你解决在centos 7下安装mysql 5.7.17所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。