【转】CentOS7 64位安装mysql5.7
【转】[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY
*************************以下为CentOS6.8安装过程******************************
1.安装
1.1 执行 yum -y install mysql-server
1.2 默认配置文件在 /etc/my.cnf
2.配置字符集
vim /etc/my.cnf
在[mysqld]节点下增加:
character-set-server=utf8
collation-server=utf8_general_ci
3.自启动配置
执行chkconfig mysqld on
执行chkconfig --list mysqld (如果2-5位启用on状态即ok)
4.防火墙配置
vim /etc/sysconfig/iptables
添加到防火墙配置中:
-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
重启防火墙
service iptales restart
5.mysql配置
5.1查看目前mysql的用户
select user,host,password from mysql.user;
5.2修改root密码
set password for root@localhost=password('123456');
set password for root@127.0.0.1=password('123456');
5.3 删除匿名用户
delete from mysql.user where user='';
5.4 刷新,使操作生效
flush privileges;
5.5插入mysql新用户
insert into mysql.user(host,user,password)
values('localhost','test',password('123456'));
5.6给账号开通外网所有权限
grant all privileges on database.* to name@'%' identified by 'password';