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

MySQL5.7安装

时间:2019-08-10 11:52:13      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:打开   上传文件   批评   ike   完成   gre   spec   variable   admin   

MySQL5.7安装

1.yum安装,先要搞到源

wget http://repo.mysql.com/mysql57-community-release-el7-9.noarch.rpm

sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm

 

2.更新yum软件包

yum check-update  

 

3.更新系统

yum update

 

4.安装mysql

yum install mysql mysql-server

 

*********************接下来是漫长的等待。如果中途关机,或者下载挂了,请执行卸载步骤后,再来一次。完成后记住要给root上密码***********

systemctl start mysqld

 

mysql -u root

 

mysql> update mysql.user set authentication_string=password(‘admin‘) where user=‘root‘ and Host =‘localhost‘;

mysql> flush privileges;

mysql> quit;

 

5.启动与开放远程访问

systemctl start mysqld

mysql -u root -p

6.授权远程访问

use mysql;

grant all privileges  on *.* to root@‘%‘ identified by "admin";

 

grant all privileges  on *.* to piwik@‘%‘ identified by "ph20190420";

FLUSH PRIVILEGES;

 

create user user@‘%‘ identified by ‘admin‘

7.查看初始密码

grep ‘temporary password‘  /var/log/mysqld.log

 

 

1.root登陆mysql

 

8.密码强度低时报错问题解决

mysql> set global validate_password_policy=0;   

  

mysql> set global validate_password_mixed_case_count=0;    

 

mysql> set global validate_password_number_count=3;    

 

mysql> set global validate_password_special_char_count=0;

 

mysql> set global validate_password_length=3;    

 

 

alter user root@localhost identified by ‘admin‘;

 

9.数据库启动,停止,重启

systemctl start mysqld

systemctl stop mysqld

service mysqld restart

 

 

 

10.修改max_allowed_packet

VI打开/etc/my.cnf,增加下面一行,这句话是把上传文件大小改到64M

max_allowed_packet = 64M    piwik建议

查看当前大小

show variables like ‘%max_allowed_packet%‘; 

 

 

至此,安装过程结束,以上为亲自实操,或许由于环境问题,好多异常情况没有遇见,希望大家一起多多交流,共同成长,不足之处请多多批评

MySQL5.7安装

标签:打开   上传文件   批评   ike   完成   gre   spec   variable   admin   

原文地址:https://www.cnblogs.com/michaelcnblogs/p/11330745.html

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