标签:tar roo host mysql 初始密码 安装 mysql 字母 设置 rar
CentOS 版本为6.5
使用yum 安装mysql,要使用mysql的yum仓库,先从官网下载适合你系统的仓库
https://dev.mysql.com/downloads/repo/yum/
我下载的是 mysql57-community-release-el6-11.noarch.rpm
安装 yum localinstall mysql-community-release-el6-5.noarch.rpm
yum install mysql-community-server
sudo service mysqld start
查看初始密码
grep “password” /var/log/mysqld.log
2017-06-11T20:14:59.383788Z 1 [Note] A temporary password is generated for root@localhost: e.Vsb5=28=.v
密码为 :e.Vsb5=28=.v
SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘14130220’); // 为root账号设置密码
此时如有报错 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
设置密码过于简单
set global validate_password_policy=0; // 默认1 即必须含有1个数字、小写或大写字母、特殊字符
set global validate_password_length=4; // 默认8 即密码长度
GRANT ALL PRIVILEGES ON . TO ‘myuser‘@’%’ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;
注意:’myuser’、’mypassword’ 需要替换成实际的用户名和密码。
vim /etc/my.cnf
[mysql]
default-character-set=utf8
[mysqld]
character_set_server=utf8
重启
service mysqld restart
标签:tar roo host mysql 初始密码 安装 mysql 字母 设置 rar
原文地址:http://www.cnblogs.com/rzstrong/p/7144942.html