MySQL 5 7在RHEL CentOS上的安裝

2021-09-21 12:09:23 字數 1534 閱讀 2906

mysql-community-client-5.7.11-1.el6.x86_64.rpm

mysql-community-libs-5.7.11-1.el6.x86_64.rpm

mysql-community-common-5.7.11-1.el6.x86_64.rpm

mysql-community-server-5.7.11-1.el6.x86_64.rpm

cd mysql5.7

rpm -ihv *.rpm --nodeps

注:我的環境不乾淨,裝了多套mysql。正常應該把上面的"--nodeps"去掉,或者用"yum install *.rpm"安裝。

如果由於和已安裝的mysql衝突失敗,解除安裝衝突的舊版mysql再執行,比如:

rpm -e mysql-libs-5.1.61 --nodeps

rpm -e mysql-5.1.61 --nodeps

vi /etc/my.cnf

mysqld --initialize --user mysql

mysqld_safe &

mysql -s /opt/mysql57_data/mysql.sock -uroot -pqxay8wk3rl*t -e "alter user user() identified by 'mysql'"

上面假設資料目錄為"/opt/mysql57_data",初始密碼"qxay8wk3rl*t",這兩項需要根據實際情況修改。

初始密碼可以在錯誤日誌裡找到:

vi /opt/mysql57_data/mysql-error.log

...

2016-05-06t08:37:29.767232z 1 [note] a temporary password is generated for root@localhost: qxay8wk3rl*t

vi ~/.my.cnf

[client]

user = root

password = mysql

port=3306

socket = /opt/mysql57_data/mysql.sock

[root@node1 ~]# mysql

welcome to the mysql monitor. commands end with ; or \g.

your mysql connection id is 160

server version: 5.7.11-log mysql community server (gpl)

oracle is a registered trademark of oracle corporation and/or its

affiliates. other names may be trademarks of their respective

owners.

type 'help;' or '\h' for help. type '\c' to clear the current input statement.

mysql>

mysql5 7學習 mysql 5 7 學習

mysql uroot proot mysql5.7 mysql.user表沒有password欄位改 authentication string 一.建立使用者 命令 create user username host identified by password 例子 create user d...

MySQL5 7在CentOS Linux環境安裝

在centos中預設安裝有mariadb,這個是mysql的分支,但為了需要,還是要在系統中安裝mysql,而且安裝完成之後可以直接覆蓋掉mariadb。root localhost wget i c root localhost yum y install mysql57 community re...

mysql5 7如何開啟 mysql57怎麼開啟

開啟mysql57的方法 首先開啟winodws執行視窗 然後在開啟編輯框中輸入cmd命令 最後在終端介面中輸入 mysql hlocalhost uroot p123 即可顯示開啟mysql資料庫。windows下用命令列啟動mysql5.7 win菜單鍵即是在鍵盤左下角 ctrl控制 鍵與 al...