±—±--------±------+
| id | name | addr |
±—±--------±------+
| 1 | alibaba | china |
±—±--------±------+
1 row in set (0.00 sec)
这样主数据库就配置好了
配置从数据库的节点
[root@samba ~]# systemctl restart mariadb
[root@samba ~]# mysql -uroot -p000000
MariaDB [(none)]> change master to master_host=‘mysql1’,master_user=‘user’,master_password=‘000000’;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> start slave;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: mysql1
Master_User: user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 527
Relay_Log_File: mariadb-relay-bin.000002
Relay_Log_Pos: 811
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
配置成功,开始验证主从数据库的关联功能,试试能否在虚拟机2也就是从数据库访问到刚才在主数据库建立的表格信息
MariaDB [(none)]> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
±-------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [test]> show tables;
±---------------+
| Tables_in_test |
±---------------+
| company |
±---------------+
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Linux运维工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Linux运维全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Linux运维知识点,真正体系化!
由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新
如果你觉得这些内容对你有帮助,可以添加VX:vip1024b (备注Linux运维获取)
有帮助,可以添加VX:vip1024b (备注Linux运维获取)**
[外链图片转存中…(img-l67WsMJF-1712604972195)]