1
從官網(wǎng)上下載MySQL安裝包mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar
2
解壓文件:
tar -xvf mysql-5.7.26-1.el7.x86_64.rpm-bundle.tar
3
本地安裝 comm client libs libs-compat dev server 根據(jù)實際安裝環(huán)境安裝其他缺失的包
yum localinstall mysql-community-libs-5.7.26-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.26-1.el7.x86_64.rpm mysql-community-common-5.7.26-1.el7.x86_64.rpm mysql-community-client-5.7.26-1.el7.x86_64.rpm mysql-community-devel-5.7.26-1.el7.x86_64.rpm mysql-community-server-5.7.26-1.el7.x86_64.rpm
4
初始化mysql
mkdir /udata/mysql
chown mysql:mysql /udata/mysql
修改/etc/my.cnf
datadir=/udata/mysql 如果修改了socket的位置務(wù)必[client] 加上socket 對應的位置
myqld --initialize 并查看mysql生成的隨機密碼 ,默認位于 /var/log/mysqld.log中
5
啟動mysql服務(wù)
systemctl enable mysqld
systemctl start mysqld
6
mysql -uroot -p上訴隨機密碼 連接到mysql
set password = password('xxx') 修改密碼 xxx為修改后的密碼
7
update user set host = '%' where host='localhost';
flush privileges
允許其他主機遠程連接mysql
當前題目:Centos安裝mysql5.7
網(wǎng)站URL:
http://weahome.cn/article/igdsgg.html