码迷,mamicode.com
首页 > 数据库 > 详细

mysql

时间:2019-05-07 23:01:03      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:sql   yum   mysql5.7   word   col   远程   div   操作   blog   

centos mysql

安装

https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

# 下载 rpm <https://dev.mysql.com/downloads/repo/yum/>
$ wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
# 安装 rpm
$ sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
# 安装 mysql
$ sudo yum install mysql-community-server

注意:centos7 选择 Red Hat Enterprise Linux 7.


mysql5.7之后,首次登录操作如下:

# 获取首次登录密码
$ sudo grep temporary password /var/log/mysqld.log
# 用获取的密码登录
$ mysql -uroot -p
# 修改密码
$ ALTER USER root@localhost IDENTIFIED BY MyNewPass4!;

https://dev.mysql.com/doc/refman/5.7/en/using-systemd.html

 

报错:1130-host ... is not allowed to connect to this MySql server

原因:登录账号只允许 localhost 登录,需要修改账号远程登录权限。https://www.cnblogs.com/xyzdw/archive/2011/08/11/2135227.html

mysql> use mysql;

mysql> update user set host = % where user = root;

mysql> select host, user from user;

mysql> FLUSH   PRIVILEGES;

记得一定要flush privileges!!! 修改才能生效!

 

mysql

标签:sql   yum   mysql5.7   word   col   远程   div   操作   blog   

原文地址:https://www.cnblogs.com/da-liny/p/10828522.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!