MySQL 5.7.13-1.el6.x86_64 安装配置总结

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

[root@test]# yum install mysql

[root@test]# yum install mysql-server

[root@test]# yum install mysql-devel

[root@test /]# /etc/init.d/mysqld restart 重启一下数据库,会自动进行初始化。

[root@test /]# cat /var/log/mysqld.log | grep "temporary password" 查看密码

2016-06-03T11:22:35.841809Z 1 [Note] A temporary password is generated for root@localhost: 8!Q%r!3:6zs(

[root@test /]# mysql -uroot -p //输入密码

mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost'; //更新密码

===========================================================

安装完mysql 之后,登陆以后,不管运行任何命令,总是提示这个

You must reset your password using ALTER USER statement before executing this statement.

step 1: SET PASSWORD = PASSWORD('your new password');

step 2: ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;

step 3: flush privileges;

============================================================

mysql> update mysql.user set host = '%'  where user ='root'; //设置意IP可以访问

mysql> flush privileges;

  • 必须使用alter user 重置密码:
    mysql> show databases;
    ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
  • 重新设置密码:
    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '********'

配置文件目录: /etc/my.cnf 

 

set GLOBAL max_connections=300

升级到最新的mysql

yum -y upgrade mysql 

 

CentOS Linux更改MySQL5.7数据库目录位置

cp -a mysql /data/mysql/  参数a表示权限一致

datadir=/data/mysql

socket=/data/mysql/mysql.sock

转载于:https://my.oschina.net/hycx227/blog/686799

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值