Centos 使用YUM安裝MariaDB

2021-09-06 11:41:12 字數 1724 閱讀 3855

1、在/etc/yum.repos.d/下建立 mariadb.repo,內容如下:

[azureuser@mono etc]$ cd /etc/yum.repos.d

[azureuser@mono yum.repos.d]$ vi mariadb.repo

# mariadb 10.0 centos repository list - created 2013-08-23 13:08 utc

# [mariadb]

name = mariadb

baseurl =

gpgkey=

gpgcheck=1

如果是其他的作業系統,可以在這裡找到相關資訊。

2、使用yum安裝mariadb

[azureuser@mono yum.repos.d]$ sudo yum -y install mariadb-client mariadb-server mariadb-devel

3、啟動資料庫

[azureuser@mono yum.repos.d]$ sudo service mysql start 

4、修改root的密碼

[azureuser@mono yum.repos.d]$ mysqladmin -u root password 『passwd』

5、配置遠端訪問,mariadb為了安全起見,預設情況下繫結ip( 127.0.0.1)。

[azureuser@mono yum.repos.d]$ mysql -u root -p

enter password:

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

your mariadb connection id is 4

server version: 10.0.4-mariadb mariadb server

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

mariadb [(none)]>grant all privileges on *.* to 'root'@'%' identified by 『passwd』 with grant option;

mariadb [(none)]> flush privileges;

第一句中"%"表示任何主機都可以遠端登入到該伺服器上訪問。如果要限制只有某台機器可以訪問,將其換成相應的ip即可,如:

grant all privileges on *.* to root@"172.168.193.25" identified by "root";

6、如果系統的防火牆開著(or behind a hardware firewall or nat)你必須放開mysql使用的tcp埠,通常都是3306。

7、大小寫敏感

用root帳號登入後,在/etc/my.cnf 中的[mysqld]後新增新增lower_case_table_names=1,重啟mysql服務,這時已設定成功:不區分表名的大小寫;

lower_case_table_names引數詳解:

lower_case_table_names = 0

其中 0:區分大小寫,1:不區分大小寫

osx 上安裝 mariadb

mysql初始化root密碼和允許遠端訪問

mysql管理工具heidisql

Centos 使用YUM安裝MariaDB

azureuser mono etc cd etc yum.repos d azureuser mono yum.repos d vi mariadb.repo拷貝以下內容 gpgcheck 1如果是其他的作業系統,可以在這裡找到相關資訊。azureuser mono yum.repos d sud...

CentOS使用yum安裝mysql

1 檢視centos自帶mysql是否已安裝。輸入 yum list installed grep mysql 輸入 yum y remove mysql libs.x86 64,若有多個依賴檔案則依次解除安裝。當結果顯示為complete!即解除安裝完畢。輸入 yum list grep mysq...

CentOS使用yum安裝Redis

1.直接yum 安裝的redis 不是最新版本,也有可能沒有yum源導致不成功 yum install redis 2.從官網安裝最新的redis 2 使用命令安裝最新版本的redis yum install y yum enablerepo remi install redis 3.裝乙個第三方的...