檢視mariadb版本
rpm -qa | grep mariadb
解除安裝mariadb
rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
重啟機器
reboot
將mysql-8.0.18-1.el8.x86_64.rpm-bundle.tar安裝包上傳到/opt/software目錄
解壓mysql安裝包到/opt/server目錄
tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar -c /opt/server
必須安裝(注意順序)
rpm -ivh mysql-community-common-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.13-1.el7.x86_64.rpm
非必要安裝(注意順序)
rpm -ivh mysql-community-libs-compat-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-embedded-compat-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.13-1.el7.x86_64.rpm
rpm -ivh mysql-community-test-8.0.13-1.el7.x86_64.rpm
如何報以下錯誤:
error:
failed dependencies:
libnuma.so.1()(64bit) is needed by mysql-community-server-8.0.13-1.el7.x86_64 libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-8.0.13-1.el7.x86_64 libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-8.0.13-1.el7.x86_64
解決辦法:
yum install numactl
出現問題:
error:
failed dependencies:
pkgconfig(openssl) is needed by mysql-community-devel-8.0.13-1.el7.x86_64
解決辦法:
yum install openssl-devel.x86_64 openssl.x86_64 -y
error:
failed dependencies:
perl(data::dumper) is needed by mysql-community-test-8.0.13-1.el7.x86_64
解決辦法:
yum -y install autoconf
error:
failed dependencies:
perl(json) is needed by mysql-community-test-8.0.13-1.el7.x86_64
解決辦法:
yum install perl.x86_64 perl-devel.x86_64 -y
yum install perl-json.noarch -y
mysqld --initialize --console
chown -r mysql:mysql /var/lib/mysql/
systemctl start mysqld
將mysql服務設定為開機啟動
輸入臨時密碼(輸入時不會顯示出來,輸入完直接回車)
alter user 'root'@'localhost' identified by '新密碼';
檢視所有使用者是否可以遠端連線,依次執行下列命令:
host為localhsot,說明使用者只能本地連線msyql服務
修改root使用者host值,使root使用者可以遠端登入
update user set host = "%" where user='root'; 重新整理
flush privileges;
開啟mysql遠端訪問許可權
use mysql;
alter user 'root'@'%' identified with mysql_native_password by 'root使用者的密碼';
flush privileges;
12.1 centos埠被防火牆遮蔽
12.2 linux配置檔案錯誤
修改配置檔案 vi /etc/mycnf
新增 port=3306
bind-address = 0.0.0.0
儲存後重啟mysql:systemctl restart mysqld
centos安裝mysql教程
上傳檔案 scp mysql root 192.168.0.111 root 解壓 tar zxvf mysql 5.7 tar.gz mv mysql 5.7 usr local mysql cd usr local mysql 建立使用者和使用者組 groupadd mysql useradd ...
CentOS 安裝MySQL 詳細教程
一 安裝 3 安裝 mysql 服務端 yum y install mysql community server 報錯了 no match for argument mysql community server error unable to find a match mysql community...
CentOS安裝mysql教程(實測成功)
yum localinstall mysql community 5.7.23 1.el6.src.rpmyum install mysql serverservice mysqld start 如果出現啟動失敗如下圖,則使用命令rm fr var lib mysql 重新初始化mysql,然後再重...