Red Hat Enterprise Linux Server release 7.4 (Maipo) 安装mysql5.7.36
1. 版本
?
[root@localhost mysql]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.4 (Maipo)[root@localhost mysql]# ll -rw-r--r--. 1 root root 545863680 11月 4 19:55 mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar2. 解壓 mysql
?
tar -xvf mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar
3. 安裝mysql
解壓后的
?
-rw-r--r--. 1 root root 545863680 11月 4 19:55 mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar
-rw-r--r--. 1 7155 31415 26664808 9月 8 08:34 mysql-community-client-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 317808 9月 8 08:34 mysql-community-common-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 4118740 9月 8 08:34 mysql-community-devel-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 47760636 9月 8 08:34 mysql-community-embedded-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 23316608 9月 8 08:34 mysql-community-embedded-compat-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 132191192 9月 8 08:34 mysql-community-embedded-devel-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 2473272 9月 8 08:34 mysql-community-libs-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 1263988 9月 8 08:34 mysql-community-libs-compat-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 182267476 9月 8 08:34 mysql-community-server-5.7.36-1.el7.x86_64.rpm
-rw-r--r--. 1 7155 31415 125479900 9月 8 08:35 mysql-community-test-5.7.36-1.el7.x86_64.rpm
安裝:rpm -ivh mysql-community-common-5.7.36-1.el7.x86_64.rpm? 提示: file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64
[root@localhost mysql]# rpm -ivh mysql-community-common-5.7.36-1.el7.x86_64.rpm 警告:mysql-community-common-5.7.36-1.el7.x86_64.rpm: 頭V3 DSA/SHA256 Signature, 密鑰 ID 5072e1f5: NOKEY 準備中... ################################# [100%]file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/dutch/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/english/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/estonian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/french/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/german/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/greek/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/italian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/japanese/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/korean/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/polish/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/romanian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/russian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/serbian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/slovak/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/spanish/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/swedish/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/armscii8.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/ascii.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/cp1250.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/cp1251.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/cp1256.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/cp1257.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/cp850.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/cp852.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/cp866.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/dec8.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/geostd8.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/greek.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/hebrew.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/hp8.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/koi8r.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.56-2.el7.x86_64 [root@localhost mysql]#原因:
? ? ? ? 已經(jīng)安裝??mariadb-libs
[root@localhost mysql]# rpm -qa | grep mariadb-libs
mariadb-libs-5.5.56-2.el7.x86_64
?
需要卸載 ,mariadb-libs
yum remove -y mariadb-libs-5.5.56-2.el7.x86_64
[root@localhost mysql]# yum remove -y mariadb-libs-5.5.56-2.el7.x86_64 已加載插件:langpacks, product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. 正在解決依賴關(guān)系 --> 正在檢查事務(wù) ---> 軟件包 mariadb-libs.x86_64.1.5.5.56-2.el7 將被 刪除 --> 正在處理依賴關(guān)系 libmysqlclient.so.18()(64bit),它被軟件包 2:postfix-2.10.1-6.el7.x86_64 需要 --> 正在處理依賴關(guān)系 libmysqlclient.so.18(libmysqlclient_18)(64bit),它被軟件包 2:postfix-2.10.1-6.el7.x86_64 需要 --> 正在檢查事務(wù) ---> 軟件包 postfix.x86_64.2.2.10.1-6.el7 將被 刪除 --> 解決依賴關(guān)系完成依賴關(guān)系解決===============================================================================================================================================Package 架構(gòu) 版本 源 大小 =============================================================================================================================================== 正在刪除:mariadb-libs x86_64 1:5.5.56-2.el7 @anaconda/7.4 4.4 M 為依賴而移除:postfix x86_64 2:2.10.1-6.el7 @anaconda/7.4 12 M事務(wù)概要 =============================================================================================================================================== 移除 1 軟件包 (+1 依賴軟件包)安裝大小:17 M Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction 警告:RPM 數(shù)據(jù)庫已被非 yum 程序修改。正在刪除 : 2:postfix-2.10.1-6.el7.x86_64 1/2 正在刪除 : 1:mariadb-libs-5.5.56-2.el7.x86_64 2/2 驗證中 : 1:mariadb-libs-5.5.56-2.el7.x86_64 1/2 驗證中 : 2:postfix-2.10.1-6.el7.x86_64 2/2 刪除:mariadb-libs.x86_64 1:5.5.56-2.el7 作為依賴被刪除:postfix.x86_64 2:2.10.1-6.el7 完畢! [root@localhost mysql]#?
然后依次 安裝:
rpm -ivh mysql-community-common-5.7.36-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.36-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.36-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.36-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.36-1.el7.x86_64.rpm
4. 查看、啟動、關(guān)閉 mysql
service mysqld status
service mysqld start
service mysqld stop
?
5. 首次登錄 查找密碼
grep "temporary password" /var/log/mysqld.log
本次的 密碼是 z?u;EkW2Fgfa
6. 登錄mysql 修改密碼
mysql -u root -p? ? ?##回車,選擇自己安裝的?提示的密碼,z?u;EkW2Fgfa
登錄mysql后, 設(shè)置密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密碼';
?
6.? 如果有需要 設(shè)置其他ip可以登錄本機mysql
6.1 登錄mysql
[root@localhost ~]# mysql -u root -p
Enter password:?
6.2 設(shè)置
mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -ADatabase changed mysql> mysql> select 'host' from user where user='root'; +------+ | host | +------+ | host | +------+ 1 row in set (0.00 sec)mysql> update user set host = '%' where user ='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)mysql> select 'host' from user where user='root'; +------+ | host | +------+ | host | +------+ 1 row in set (0.00 sec)mysql>?
總結(jié)
以上是生活随笔為你收集整理的Red Hat Enterprise Linux Server release 7.4 (Maipo) 安装mysql5.7.36的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 谈task_struct
- 下一篇: 病中梦记