使用Centos7 2搭建資料庫

2021-10-05 22:18:49 字數 1467 閱讀 7754

>

wget -i -c

> yum -y install mysql57-community-release-el7-10.noarch.rpm

> yum -y install mysql-community-server

1. 獲取初始密碼

>

grep

"password" /var/log/mysqld.log

如果使用本命令獲取不到臨時密碼,是因為之前安裝的mysql刪除殘留導致,使用命令刪除殘留資料,並重啟mysqld服務後重新獲取即可

# 刪除殘留資料

>

rm -rf /var/lib/mysql

# 重啟服務

> systemctl restart mysqld

登入mysql

> mysql -uroot -p

> enter your password: 上面獲取的初始密碼

修改mysql的root使用者密碼

> alter user 'root'@'localhost' identified by '你的密碼'

;

如果設定的密碼過於簡單,系統會提示error 1819 (hy000): your password does not satisfy the current policy requirements,此時需要調整設定密碼的複雜度,需要8位以上字母大小寫特殊符號以及數字的密碼,或者使用如下命令更改mysql密碼規則,然後再重新設定密碼

>

set global validate_password_policy=0;

>

set global validate_password_length=6;

> alter user 'root'@'localhost' identified by '你的密碼』;

> grant all privileges on *.* to 'root'@'%' identified by '你的密碼'

CentOS 7 2搭建NFS並使用

伺服器名 內網位址 掛載目錄 服務端192.168.200.10 public 客戶端192.168.200.11 public 提供一塊10g硬碟作為共享資料夾的掛載硬碟 關閉防火牆和安全模組,本次僅做測試,不需要安全方面額外設定 1 在192.168.200.10的主機上安裝 服務端 yum y...

CentOS 7 2搭建NFS並使用

伺服器名 內網位址 掛載目錄 服務端192.168.200.10 public 客戶端192.168.200.11 public 提供一塊10g硬碟作為共享資料夾的掛載硬碟 關閉防火牆和安全模組,本次僅做測試,不需要安全方面額外設定 1 在192.168.200.10的主機上安裝 服務端 yum y...

CentOS7 2搭建ownCloud私有雲

1.準備工具 1 securecrt8.0 2 securefx8.0 以上工具 1 是用於連線遠端伺服器,運用linux命令操作伺服器。工具 2 用於本地檔案和伺服器檔案傳輸使用,操作方便。3 伺服器 apache 2.4 4 資料庫 資料庫 mysql mariadb 5 php5.6 2.配置...