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

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

[root@test]# yum install mysqlsql

[root@test]# yum install mysql-server数据库

[root@test]# yum install mysql-develsocket

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

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

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

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

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

===========================================================get

安装完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

相关文章
相关标签/搜索