centos7 搭建个人-企业私有云盘-seafile
作者:互联网
centos7 搭建个人-企业私有云盘-seafile
一、MySQL安装之yum安装
MySQL安装之yum安装
在CentOS7中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要在系统中安装MySQL,而且安装完成之后可以直接覆盖掉MariaDB。
1. 下载并安装MySQL官方的 Yum Repository
[root@BrianZhu /]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
使用上面的命令就直接下载了安装用的Yum Repository,大概25KB的样子,然后就可以直接yum安装了。
[root@BrianZhu /]# yum -y install mysql57-community-release-el7-10.noarch.rpm
下面就是使用yum安装MySQL了
[root@BrianZhu /]# yum -y install mysql-community-server
这步可能会花些时间,安装完成后就会覆盖掉之前的mariadb。
2. MySQL数据库设置
首先启动MySQL
[root@BrianZhu /]# systemctl start mysqld.service
查看MySQL运行状态
[root@BrianZhu /]# systemctl status mysqld.service
此时MySQL已经开始正常运行,不过要想进入MySQL还得先找出此时root用户的密码,通过如下命令可以在日志文件中找出密码:
[root@BrianZhu /]# grep "password" /var/log/mysqld.log
上面标记的就是初始密码
如下命令进入数据库:
[root@BrianZhu /]# mysql -uroot -p # 回车后会提示输入密码
输入初始密码,此时不能做任何事情,因为MySQL默认必须修改密码之后才能操作数据库:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
这里有个问题,新密码设置的时候如果设置的过于简单会报错:
原因是因为MySQL有密码设置的规范,具体是与validate_password_policy的值有关:
MySQL完整的初始密码规则可以通过如下命令查看:
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 4 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 1 |
+--------------------------------------+-------+
rows in set (0.01 sec)
密码的长度是由validate_password_length决定的,而validate_password_length的计算公式是:
validate_password_length = validate_password_number_count + validate_password_special_char_count + (2 * validate_password_mixed_case_count)
解决方法就是修改密码为规范复杂的密码:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'z?guwrBhH7p>';
Query OK, 0 rows affected (0.00 sec)
mysql>
这时候我们要把密码规则改一下,执行下面sql就可以了:
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.00 sec)
mysql>
设置之后就是我上面查出来的那几个值了,此时密码就可以设置的很简单,例如1234之类的。到此数据库的密码设置就完成了。
但此时还有一个问题,就是因为安装了Yum Repository,以后每次yum操作都会自动更新,需要把这个卸载掉:
[root@BrianZhu ~]# yum -y remove mysql57-community-release-el7-10.noarch
配置算是完成了
可视化工具的登录授权:(如果授权不成功,请查看防火墙)
操作完成上面的,现在还不能用可视化的客户端进行连接,需要我们进行授权:
grant all on *.* to root@'%' identified by '数据库密码';
大功告成!!!
二、yum install mysql-community-server依赖关系错误处理
该解决方案为卸载重装;如果看客不能卸载,请直接关闭
系统:Centos 6-7
MySQL 版本:MySQL 5.7
#yum安装mysql5.7
yum install mysql-community-server
结果报如下错误:
[root@host ~]# yum install mysql-community-server
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.san.fastserv.com
* elrepo-kernel: repos.lax-noc.com
* extras: mirrors.oit.uci.edu
* updates: mirror.keystealth.org
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.7.20-1.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.7.20-1.el7 for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libsasl2.so.3()(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libnuma.so.1()(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.20-1.el7 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.20-1.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community-client-5.7.20-1.el7.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package: mysql-community-client-5.7.20-1.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.7.20-1.el7 will be installed
---> Package mysql-community-server.x86_64 0:5.7.20-1.el7 will be installed
--> Processing Dependency: systemd for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libsasl2.so.3()(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
---> Package numactl.x86_64 0:2.0.9-2.el6 will be installed
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.7.20-1.el7 will be installed
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community-client-5.7.20-1.el7.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package: mysql-community-client-5.7.20-1.el7.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.20-1.el7 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package: mysql-community-libs-5.7.20-1.el7.x86_64
---> Package mysql-community-server.x86_64 0:5.7.20-1.el7 will be installed
--> Processing Dependency: systemd for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: systemd for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.15)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libc.so.6(GLIBC_2.17)(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Processing Dependency: libsasl2.so.3()(64bit) for package: mysql-community-server-5.7.20-1.el7.x86_64
--> Finished Dependency Resolution
Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community)
Requires: libsasl2.so.3()(64bit)
Error: Package: mysql-community-client-5.7.20-1.el7.x86_64 (mysql57-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mysql-community-libs-5.7.20-1.el7.x86_64 (mysql57-community)
Requires: libc.so.6(GLIBC_2.14)(64bit)
Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community)
Requires: systemd
Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community)
Requires: libstdc++.so.6(GLIBCXX_3.4.15)(64bit)
Error: Package: mysql-community-client-5.7.20-1.el7.x86_64 (mysql57-community)
Requires: libc.so.6(GLIBC_2.14)(64bit)
Error: Package: mysql-community-server-5.7.20-1.el7.x86_64 (mysql57-community)
Requires: libc.so.6(GLIBC_2.17)(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
查询各种信息;基本确定是因为 mysql 的依赖问题;由于对本来说,最快的解决方案就是卸载重装.
卸载方法:
1.快速删除
yum remove mysql mysql-server mysql-libs mysql-server
2.查找残留文件
rpm -qa | grep -i mysql
将查询出来的文件逐个删除,如:
yum remove mysql-community-common-5.7.20-1.el6.x86_64
4.查找残留目录
whereis mysql
逐条删除目录,如:
rm –rf /usr/lib64/mysql
上述做完后,最好重新查询相关内容,防止漏删
安装:
转自https://segmentfault.com/a/1190000003049498
检测系统是否存在mysql
yum list installed | grep mysql
删除mysql依赖项
yum -y remove mysql-libs.x86_64
3.给CentOS添加rpm源,并且选择较新的源
wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum localinstall mysql-community-release-el6-5.noarch.rpm
yum repolist all | grep mysql
yum-config-manager --disable mysql55-community
yum-config-manager --disable mysql56-community
yum-config-manager --enable mysql57-community-dmr
yum repolist enabled | grep mysql
安装mysql 服务器
# yum install mysql-community-server
终于没有报错,可以继续了
三、搭建个人/企业私有云盘-seafile
#安装依赖组件
安装前的准备工作安装 Seafile 服务器之前,请确认已安装以下软件MariaDB 或者 MySQL 服务器 (MariaDB 是 MySQL 的分支),python 2.7 (从 Seafile 5.1 开始,python 版本最低要求为2.7):
yum install -y python python-setuptools python-imaging python-ldap python-urllib3 python-memcache MySQL-python mariadb mariadb-devel mariadb-server
#安装srafile
1、下载解压srafile包
cd /usr/src
wget -c http://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_6.0.8_x86-64.tar.gz
tar -xzf seafile-server_6.0.8_x86-64.tar.gz
mkdir -p /data/seafile/installed
mv seafile-server_6.0.8 /data/seafile/installed
cd /data/seafile/installed/seafile-server-6.0.8
2、运行安装脚本并回答预设问题:
1)./setup-seafile-mysql.sh,设置服务器名称,输入seafile,并回车:
3)输入域名或者ip,这里小编就填写服务器ip了,懒得弄域名,回车。
4)接下来就是设置存放你的宝贝资源的文件目录了,这里要选择大的磁盘路径哦,小编这里www目录挂载的磁盘是最大的,所要当初下载文件的时候都是往www目录里下载。因此程序默认的文件就在www下。回车:
5)接下来是设置端口号,小编这里就默认了,直接回车,如果你的服务器8082端口被占用,就改别的吧。回车:
6)下面是新建数据库或者选择已经存在的数据库,我们是新安装的,当然是新建,果断选1,回车:
7)再下面是填写数据库服务器地址,我这个就是本机,默认即可。回车:
8)下面是填写数据库端口,一般都是3306,默认,回车:
9)下面是输入数据库用户名为root的密码,这个在安装lnmp的时候是你自己设置的。这里注意,linux输入密码是不显示的,你直接输入即可,输入完成按回车:
10)下面为seafile创建mysql用户,输入用户名,默认即可。回车:
11)给数据库用户seafile设定密码,还是什么都不显示的 输入即可。回车:
12)设置ccnet服务的数据库名,默认,回车:
13)给seafile-server起个数据库名,默认,回车:
14)给seahub设置数据库名……,默认,回车!!!!!!!
15)启动seafile服务
./seafile.sh start
16)启动seahub,并设置后台登陆邮箱
./seahub.sh start
输入登录密码=》确认密码=》启动成功!
16)登录网页版网盘,并配置。
在浏览器中输入:http://150.107.0.174:8000/ (你的ip地址:端口号)就会重定向到登陆界面:
标签:x86,5.7,云盘,community,centos7,64,mysql,seafile,el7 来源: https://www.cnblogs.com/xiaoyaojinzhazhadehangcheng/p/14035180.html