redhat6-64位操作系统下安装mysql-5.7.18过程

来源:互联网 发布:linux 启动命令模式 编辑:程序博客网 时间:2024/06/06 20:42

1.进入官网下载mysql
https://dev.mysql.com/downloads/mysql/

2.Tar包传至服务器下进行解压
Tar –xvf mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar
3.解压 后安装如下包:
rpm –ivh mysql-community-common-5.7.18-1.el6.x86_64.rpm
rpm –ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm
rpm –ivh mysql-community-server-5.7.18-1.el6.x86_64.rpm
4.安装最后一个包可能会报如下错误:
libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64
5.网上下载http://rpm.pbone.net/index.php3

numactl-2.0.7-8.el6.x86_64.rpm
rpm –ivh numactl-2.0.7-8.el6.x86_64.rpm

注:在这当中我下过numactl-2.0.7-6.el6.src.rpm、numactl-libs-2.0.9-6.el7_2.x86_64.rpm安装时依然报各种依赖包错误
6.开启服务service mysqld start
7.登入root mysql -u root 或mysql 报错
8.Service mysqld stop
9.添加如下一行至/etc/my.cnf
skip-grant-tables
10.Service mysqld start
11.登入Mysql mysql –u root
12.修改密码:
update user set authentication_string=password(‘123456’) where user=’root’;
flush privileges
注:5.7.18修改密码字段不是password
13.删除/etc/my.cnf中的skip-grant-tables
14.Service mysqld restart
Mysql –u root –p123456登入数据库
15.登入成功后查询任何sql报错:
16.ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement
17.执行如下命令:
SET PASSWORD = PASSWORD(‘123456’);
18.若17命令报这个错:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
19.运行如下命令:
set global validate_password_policy=0;
set global validate_password_length=1;
20.再次执行命令:
SET PASSWORD = PASSWORD(‘123456’);
21.退出mysql重新登入mysql –u root –p123456
22.测试select now()即能正常显示表示安装成功

原创粉丝点击