小編給大家分享一下虛擬機centos7安裝MySQL的示例分析,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
創(chuàng)新互聯(lián)建站主要從事網(wǎng)站設計制作、成都網(wǎng)站建設、網(wǎng)頁設計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務。立足成都服務房山,10余年網(wǎng)站建設經(jīng)驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:13518219792
VMware下安裝CentOS-7-x86_64-Minimal:https://www.pianshen.com/article/5169307635/
[root@192 network-scripts]# rpm -qa | grep mysql
使用ip addr來查看IP
[root@192 network-scripts]# ip addr
開啟網(wǎng)卡
[root@192 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
修改ONBOOT=yes 開啟網(wǎng)卡 啟動網(wǎng)開
[root@192 network-scripts]# service network start
查看ip地址
[root@192 ~]# ip addr
查看ens33屬性inet獲取IP地址
[root@192 src]# yum install -y lrzsz
https://repo.mysql.com/yum/mysql-5.5-community/el/7/x86_64/mysql-community-release-el7-5.noarch.rpm
[root@192 network-scripts]# rpm -ivh mysql-community-release-el7-5.noarch.rpm
執(zhí)行完成后會在/etc/yum.repos.d/目錄下生成兩個repo文件mysql-community.repo mysql-community-source.repo
[root@192 network-scripts]# yum install mysql-server
[root@192 network-scripts]# systemctl start mysqld
[root@192 network-scripts]# vim /etc/my.cnf
打開文檔在[mysqld]后面任意一行添加“skip-grant-tables”用來跳過密碼驗證的過程,保存文檔并退出::wq
[root@192 network-scripts]# mysql -u root -p
[root@192 network-scripts]#mysql> show databases;
[root@192 network-scripts]#mysql> use mysql;
[root@192 network-scripts]#mysql> show tables;
[root@192 network-scripts]#mysql> select Host, User,Password from user;
[root@192 network-scripts]#mysql> show variables like '%storage_engine%';
[root@192 network-scripts]#systemctl stop mysqld
[root@192 network-scripts]#systemctl restart mysqld
[root@192 network-scripts]#systemctl status mysqld
[root@192 network-scripts]#systemctl enable mysqld
[root@192 network-scripts]#systemctl disable mysqld
###查看 firewalld 狀態(tài)
[root@192 network-scripts]# systemctl status firewalld
// --permanent 永久生效,沒有此參數(shù)重啟后失效 [root@192 network-scripts]# firewall-cmd --zone=public --add-port=80/tcp --permanent
[root@192 network-scripts]# firewall-cmd --reload
CentOS7環(huán)境下安裝mysql5.7:https://jingyan.baidu.com/article/ed2a5d1f2be1ef48f6be17d9.html
以上是“虛擬機centos7安裝MYSQL的示例分析”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學習更多知識,歡迎關注創(chuàng)新互聯(lián)行業(yè)資訊頻道!