mariadb涓讳粠

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mariadb涓讳粠相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/orm' title='orm'>orm   mat   sele   rom   _id   ant   creat   mysql   color   

vim /etc/my.cnf +10

i

log-bin=mysql-bin

binlog-ignore-db=information_schema

binlog-ignore-db=mysql

binlog-ignore-db=performance_schema

server-id= 1

 

 

vim /etc/my.cnf +10

i

server-id=2

read_only = 1

 

 

 

systemctl restart mariadb

 

涓诲簱

mysql -p123qwe

 

 

CREATE USER 鈥榓bc鈥楡鈥?鈥?IDENTIFIED BY 鈥?23qwe鈥?

grant replication slave on *.* to 鈥榓bc鈥楡鈥?72.16.0.227鈥?identified by 鈥?23qwe鈥?

flush privileges;

show master status;

 

MariaDB [(none)]> show master status;                                      

+------------------+----------+--------------+---------------------------------------------+

| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB                            |

+------------------+----------+--------------+---------------------------------------------+

| testsql.000001 |      5416 |              | information_schema,mysql,performance_schema |

+------------------+----------+--------------+---------------------------------------------+

1 row in set (0.00 sec)

 

浠?/p>

mysql -p123qwe

 

stop slave;

CHANGE MASTER TO MASTER_HOST=鈥?72.16.0.226鈥? MASTER_USER=鈥榓bc鈥?  MASTER_PASSWORD=鈥?23qwe鈥? MASTER_LOG_FILE=鈥榯estsql.000001鈥? MASTER_LOG_POS=5416;

start slave;        

show slave statusG;

 

select host,user from mysql.user;   

delete from mysql.user where user=鈥榬epl鈥?

show master status;

show variables like 鈥榮erver_id鈥?

 

以上是关于mariadb涓讳粠的主要内容,如果未能解决你的问题,请参考以下文章

MySQL涓讳粠澶嶅埗

鍦╠ocker涓儴缃瞨edis涓讳粠閰嶇疆

MySQL涓讳粠澶辫触鎶ラ敊璇細 Got fatal error 1236

yum安装Mariadb,二进制安装Mariadb

安装了mariadb还用安装mysql吗