[部署]CentOS安裝MariaDB

來源:互聯網
上載者:User

標籤:

環境

虛擬機器:VMWare10.0.1 build-1379776

作業系統:CentOS7 64位

步驟

1、添加MariaDB的yum倉庫源,在/etc/yum.repos.d/ 下建立 MariaDB.repo檔案,檔案內容可以到https://downloads.mariadb.org/mariadb/repositories/選擇自己的系統版本和mariadb版本,本文選了mariadb5.5:

# MariaDB 5.5 CentOS repository list - created 2015-09-08 10:16 UTC# http://mariadb.org/mariadb/repositories/[mariadb]name = MariaDBbaseurl = http://yum.mariadb.org/5.5/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1

2、使用 yum安裝,漫長的等待。

sudo yum -y install MariaDB-client MariaDB-server MariaDB-devel

3、啟動資料庫

sudo service mysql start

4、使用mysql登入本機資料庫(預設無密碼)

mysql -u root

5、修改root密碼

use mysql;update user set password=PASSWORD(‘root‘) where user=‘root‘;flush privileges;
重設密碼

如果你忘記了mysql的root密碼,一下步驟可以幫到你。

1、停止正在啟動並執行mysqld進程

killall -TERM mysqld

2、安全模式啟動mysql服務(加&表示後台啟動)

mysqld_safe --skip-grant-tables &

3、啟動後就可以不輸密碼登入mysql了

mysql -u root -p

4、修改root密碼,參考上一節步驟5

[部署]CentOS安裝MariaDB

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.