国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

MySQL8主從復(fù)制之一主一從實(shí)戰(zhàn)

這篇具有很好參考價(jià)值的文章主要介紹了MySQL8主從復(fù)制之一主一從實(shí)戰(zhàn)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

MySQL8主從復(fù)制之一主一從實(shí)戰(zhàn)

實(shí)戰(zhàn)環(huán)境,Windows Server 2008R2+MySQL8.0.27

操作系統(tǒng) MySQL版本 主/從庫(kù) IP 同步用戶(hù) 同步用戶(hù)密碼
Windows Server 2008R2+ mysql-8.0.27-winx64.zip master 192.168.3.246 synchadmin synchadmin
Windows Server 2008R2+ mysql-8.0.27-winx64.zip slave 192.168.3.247

1. 下載與環(huán)境變量配置

截至到2021-11-29最新版本為Mysql-8.0.27

  1. 官網(wǎng)下載:https://dev.mysql.com/downloads/
  2. 安裝文件:mysql-8.0.27-winx64.zip
  3. 解壓到D下:如:D:\MySqlServer\mysql-8.0.27-winx64
  4. 環(huán)境變量配置
  • 在系統(tǒng)變量中新增下面配置
變量名:MYSQL_HOME
變量值:D:\MySqlServer\mysql-8.0.27-winx64
  • 在系統(tǒng)變量的path變量值后面新增下面代碼
xxxx;%MYSQL_HOME%\bin

2. 主庫(kù)安裝與配置

  1. 在D:\MySqlServer\mysql-8.0.27-winx64下新建my.ini,內(nèi)容如下
[mysql]
# 設(shè)置mysql客戶(hù)端默認(rèn)字符集
default-character-set=utf8mb4
 
[mysqld]
# 設(shè)置3306端口
port = 3306
# 設(shè)置mysql的安裝目錄
basedir=D:\\MySqlServer\\mysql-8.0.27-winx64
# 設(shè)置 mysql數(shù)據(jù)庫(kù)的數(shù)據(jù)的存放目錄,MySQL 8+ 不需要以下配置,系統(tǒng)自己生成即可,否則有可能報(bào)錯(cuò)
# datadir=D:\\MySqlServer\\mysql-8.0.27-winx64 #8.0以下版本需要配置數(shù)據(jù)目錄
# 允許最大連接數(shù)
max_connections=20
# 服務(wù)端使用的字符集默認(rèn)為8比特編碼的latin1字符集
character-set-server=utf8mb4
# 創(chuàng)建新表時(shí)將使用的默認(rèn)存儲(chǔ)引擎
default-storage-engine=INNODB
# 默認(rèn)使用“mysql_native_password”插件認(rèn)證解決客戶(hù)端無(wú)法連接的問(wèn)題
default_authentication_plugin=mysql_native_password

#主從-主庫(kù)配置
#1.主服務(wù)器id唯一【必須】
server-id=1
#2.啟用二進(jìn)制日志【必須】
log-bin=mysql-bin
#3.主從,都可讀可寫(xiě)
#read-only=0
#4.設(shè)置不要復(fù)制的數(shù)據(jù)庫(kù)【可選】
binlog-ignore-db=mysql
#5.設(shè)置需要復(fù)制的數(shù)據(jù)庫(kù)【可選】
#binlog-do-db=要復(fù)制的數(shù)據(jù)庫(kù)名字
  1. 進(jìn)入D:\MySqlServer\mysql-8.0.27-winx64\bin目錄下,以管理員身份打開(kāi)cmd窗口,執(zhí)行下面命令,產(chǎn)生root密碼,牢記此密碼
mysqld --initialize --console

主從復(fù)制修改 master_port: 3306,mysql,數(shù)據(jù)庫(kù)

cmd窗口中的內(nèi)容如下

Microsoft Windows [版本 6.1.7601]
版權(quán)所有 (c) 2009 Microsoft Corporation。保留所有權(quán)利。

D:\MySqlServer\mysql-8.0.27-winx64\bin>mysqld --initialize --console
2021-11-29T07:09:43.953126Z 0 [Warning] [MY-010918] [Server] 'default_authentica
tion_plugin' is deprecated and will be removed in a future release. Please use a
uthentication_policy instead.
2021-11-29T07:09:43.953128Z 0 [System] [MY-013169] [Server] D:\MySqlServer\mysql
-8.0.27-winx64\bin\mysqld.exe (mysqld 8.0.27) initializing of server in progress
 as process 2056
2021-11-29T07:09:44.218752Z 1 [System] [MY-013576] [InnoDB] InnoDB initializatio
n has started.
2021-11-29T07:09:53.125000Z 1 [System] [MY-013577] [InnoDB] InnoDB initializatio
n has ended.
2021-11-29T07:09:59.234376Z 0 [Warning] [MY-013746] [Server] A deprecated TLS ve
rsion TLSv1 is enabled for channel mysql_main
2021-11-29T07:09:59.234377Z 0 [Warning] [MY-013746] [Server] A deprecated TLS ve
rsion TLSv1.1 is enabled for channel mysql_main
2021-11-29T07:09:59.359379Z 6 [Note] [MY-010454] [Server] A temporary password i
s generated for root@localhost: !pz0fpjAHg7M

D:\MySqlServer\mysql-8.0.27-winx64\bin>

# root@localhost: 后面就是生產(chǎn)的root密碼
 root@localhost: !pz0fpjAHg7M
  1. 進(jìn)入到MySQL的bin目錄下,執(zhí)行下面命令

mysqld --install [服務(wù)名](服務(wù)名可以不加默認(rèn)為mysql)

D:\MySqlServer\mysql-8.0.27-winx64\bin>mysqld --install
Service successfully installed.

D:\MySqlServer\mysql-8.0.27-winx64\bin>

如果出現(xiàn)下面這,表示已經(jīng)安裝過(guò)mysql,則使用 命令sc delete mysql刪除后重新安裝

D:\mysql-8.0.23-winx64\bin>mysqld --install
The service already exists!
  1. 安裝完成后,啟動(dòng)mysql服務(wù)
#啟動(dòng)服務(wù) 
net start mysql
# 停止服務(wù)
net stop mysql

3. 從庫(kù)安裝與配置

1. 虛擬機(jī)中安裝

如果在WMWare或VitiualBox中安裝,

  1. 則直接復(fù)制整個(gè)操作系統(tǒng)即可;
  2. 復(fù)制開(kāi)機(jī)后先將IP地址改一下
  3. 將my.ini改一下即可完成從庫(kù)的安裝

2. 實(shí)體機(jī)中安裝

  1. 將從庫(kù)my.ini中的server-id改一下,其他配置與主庫(kù)無(wú)區(qū)別,如下:
[mysql]
# 設(shè)置mysql客戶(hù)端默認(rèn)字符集
default-character-set=utf8mb4
 
[mysqld]
# 設(shè)置3306端口
port = 3306
# 設(shè)置mysql的安裝目錄
basedir=D:\\MySqlServer\\mysql-8.0.27-winx64
# 設(shè)置 mysql數(shù)據(jù)庫(kù)的數(shù)據(jù)的存放目錄,MySQL 8+ 不需要以下配置,系統(tǒng)自己生成即可,否則有可能報(bào)錯(cuò)
# datadir=D:\\MySqlServer\\mysql-8.0.27-winx64 #8.0以下版本需要配置數(shù)據(jù)目錄
# 允許最大連接數(shù)
max_connections=20
# 服務(wù)端使用的字符集默認(rèn)為8比特編碼的latin1字符集
character-set-server=utf8mb4
# 創(chuàng)建新表時(shí)將使用的默認(rèn)存儲(chǔ)引擎
default-storage-engine=INNODB
# 默認(rèn)使用“mysql_native_password”插件認(rèn)證解決客戶(hù)端無(wú)法連接的問(wèn)題
default_authentication_plugin=mysql_native_password

#主從-從庫(kù)配置
#1.從庫(kù)服務(wù)器id唯一,因主庫(kù)為1,這里配置為2【必須】
server-id=2
#2.啟用二進(jìn)制日志【必須】
log-bin=mysql-bin
#3.主從,都可讀可寫(xiě)
#read-only=0
#4.設(shè)置不要復(fù)制的數(shù)據(jù)庫(kù)【可選】
binlog-ignore-db=mysql
#5.設(shè)置需要復(fù)制的數(shù)據(jù)庫(kù)【可選】
#binlog-do-db=要復(fù)制的數(shù)據(jù)庫(kù)名字

4. 一主一從配置

1.主庫(kù)配置操作

  1. 創(chuàng)建同步用戶(hù)create user 'synchadmin'@'從庫(kù)IP' identified by 'synchadmin';
mysql> create user 'synchadmin'@'192.168.3.247' identified by 'synchadmin';
Query OK, 0 rows affected (0.09 sec)
  1. 授權(quán)
# 注意:如果不給同步用戶(hù)synchadmin,則查看slave狀態(tài)時(shí) 會(huì)出現(xiàn) “Slave_IO_Running: Connecting”
mysql> grant replication slave on *.* to 'synchadmin'@'192.168.3.247';
Query OK, 0 rows affected (0.07 sec)

mysql>

  1. 刷新權(quán)限
mysql> flush privileges;
Query OK, 0 rows affected (0.18 sec)
  1. 查看master狀態(tài)
mysql> show master status;
+------------------+----------+--------------+------------------+-------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000002 |      446 |              | mysql            |                   |
+------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)

mysql>
  1. 查看server_id
mysql> show variables like 'server_id';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id     | 1     |
+---------------+-------+
1 row in set, 1 warning (0.04 sec)

mysql>

2. 從庫(kù)配置操作

  1. 使用root賬戶(hù)登錄msyql數(shù)據(jù)庫(kù)并執(zhí)行下面命令
change master to 
master_host='192.168.3.246',
master_user='synchadmin',
master_password='synchadmin',
master_log_file='mysql-bin.000002',# 主庫(kù)執(zhí)行`show master status`命令 結(jié)果中的 File 值
master_log_pos=1151, # 主庫(kù)執(zhí)行`show master status`命令結(jié)果中的Position值
master_connect_retry=30;
  1. 命令說(shuō)明:
說(shuō)明:
master_host :主庫(kù)IP,
master_port:Master的端口號(hào)
master_user:主庫(kù)中創(chuàng)建的用于數(shù)據(jù)同步的用戶(hù)(如:synchadmin)
master_password:主庫(kù)中創(chuàng)建的用于同步的用戶(hù)的密碼(如:synchadmin)
master_log_file:指定 Slave 從哪個(gè)日志文件開(kāi)始復(fù)制數(shù)據(jù),即上文中提到的 File 字段的值
master_log_pos:從哪個(gè) Position 開(kāi)始讀,即上文中提到的 Position 字段的值
master_connect_retry:如果連接失敗,重試的時(shí)間間隔,單位是秒,默認(rèn)是60秒
在Slave 中的mysql終端執(zhí)行show slave status \G;用于查看主從同步狀態(tài)。
  1. 具體執(zhí)行結(jié)果如下:
Microsoft Windows [版本 6.1.7601]
版權(quán)所有 (c) 2009 Microsoft Corporation。保留所有權(quán)利。

D:\MySqlServer\mysql-8.0.27-winx64\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.27 MySQL Community Server - GPL

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> change master to master_host='192.168.3.246',master_user='synchadmin',mas
ter_password='synchadmin',master_log_file='mysql-bin.000003',master_log_pos=624,m
aster_connect_retry=30;
Query OK, 0 rows affected, 8 warnings (0.17 sec)

mysql>

change master to master_host='192.168.3.246',master_user='synchadmin',master_password='synchadmin',master_log_file='mysql-bin000006',master_log_pos=156,master_connect_retry=30;
  1. 查看狀態(tài)
mysql> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.3.246
                  Master_User: synchadmin
                  Master_Port: 3306
                Connect_Retry: 30
              Master_Log_File: mysqlbin.000002
          Read_Master_Log_Pos: 446
               Relay_Log_File: WIN-EC523ISE0QP-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysqlbin.000002
             Slave_IO_Running: No
            Slave_SQL_Running: No
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 446
              Relay_Log_Space: 156
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 0
                  Master_UUID:
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State:
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp:
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
       Master_public_key_path:
        Get_master_public_key: 0
            Network_Namespace:
1 row in set, 1 warning (0.01 sec)

ERROR:
No query specified

mysql>

  1. 啟動(dòng)從機(jī)服務(wù)器的復(fù)制功能
mysql> start slave;
Query OK, 0 rows affected (0.03 sec)
  1. 再次查看slave狀態(tài),如果發(fā)現(xiàn)Slave_IO_Running: No;則說(shuō)明沒(méi)成功
show slave status\G;

mysql> show slave status\G;
*************************** 1. row ***************************
               Slave_IO_State:
                  Master_Host: 192.168.3.246
                  Master_User: synchadmin
                  Master_Port: 3306
                Connect_Retry: 30
              Master_Log_File: mysqlbin.000003
          Read_Master_Log_Pos: 624
               Relay_Log_File: WIN-EC523ISE0QP-relay-bin.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysqlbin.000003
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 624
              Relay_Log_Space: 156
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 13117
                Last_IO_Error: Fatal error: The slave I/O thread stops because m
aster and slave have equal MySQL server ids; these ids must be different for rep
lication to work (or the --replicate-same-server-id option must be used on slave
 but this does not always make sense; please check the manual before using it).
               Last_SQL_Errno: 0
               Last_SQL_Error:
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
                  Master_UUID:
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Replica has read all relay log; waiting for more
updates
           Master_Retry_Count: 86400
                  Master_Bind:
      Last_IO_Error_Timestamp: 211129 16:41:58
     Last_SQL_Error_Timestamp:
               Master_SSL_Crl:
           Master_SSL_Crlpath:
           Retrieved_Gtid_Set:
            Executed_Gtid_Set:
                Auto_Position: 0
         Replicate_Rewrite_DB:
                 Channel_Name:
           Master_TLS_Version:
       Master_public_key_path:
        Get_master_public_key: 0
            Network_Namespace:
1 row in set, 1 warning (0.00 sec)
  1. 停止主從復(fù)制
mysql> stop slave;
Query OK, 0 rows affected (0.03 sec)

5. 首次登陸MySQL服務(wù)修改root密碼

  1. 使用下面命令登錄MySQL服務(wù)
D:\MySqlServer\mysql-8.0.27-winx64\bin>mysql -u root -p
Enter password: ************ # 首次登陸輸入安裝過(guò)程中產(chǎn)生的root用戶(hù)密碼,如:!pz0fpjAHg7M
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.27

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>
  1. 修改root密碼,舉例:如密碼改為 root
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> alter user 'root'@'localhost' identified with mysql_native_password  by 'root1';
Query OK, 0 rows affected (0.03 sec)
## alter user 'root'@'%' identified with mysql_native_password  by 'root';

6. 設(shè)置客戶(hù)端可連接遠(yuǎn)程MySQL服務(wù)器

  1. 用root賬號(hào)登陸,切換至mysql庫(kù)
mysql> use mysql;
Database changed
mysql>
  1. 查看host字段
# localhost 表示只能在本地訪問(wèn)
mysql> use mysql;
Database changed
mysql> select user,host from user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)

mysql>
  1. 修改host為值為”%“
# 修為改遠(yuǎn)程訪問(wèn), % 遠(yuǎn)程任何主機(jī)可以訪問(wèn)root賬戶(hù)
mysql> update user set host='%' where user='root';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0
# 刷新下權(quán)限
mysql>flush privileges;
  1. 再次使用客戶(hù)端遠(yuǎn)程連接時(shí)則會(huì)連接成功

  2. 授權(quán)語(yǔ)句5.7.x與8.x區(qū)別

# 5.7.x
grant all privileges on *.* to 'root'@'%' identified by 'root2' with grant option;
flush privileges;

# 8.x
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;

7. 主從配置常見(jiàn)問(wèn)題

  1. 主從IP、網(wǎng)絡(luò)配置是否正確
  2. 防火墻是否未關(guān)閉
  3. 同步用戶(hù)是否授權(quán)了

1. Slave_IO_Running: No

  • 出現(xiàn)問(wèn)題后,查看從庫(kù)的server_id,發(fā)現(xiàn)更主庫(kù)id是一樣的,所以問(wèn)題就出現(xiàn)在這里
mysql> show variables like 'server_id';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id     | 1     |
+---------------+-------+
1 row in set, 1 warning (0.18 sec)
  • 解決方式,將從庫(kù)的my.ini中的server_id 改為2 ,然后重啟數(shù)據(jù)庫(kù)即可解決

2. Last_IO_Errno: 13114

  1. 問(wèn)題描述:
Slave_IO_Running: No
Last_IO_Errno: 13114
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
  1. 分析

  2. 主要查看data下的bin文件名是否正確,如mysql8中正確的bin文件名為mysql-bin.000001

  3. 主庫(kù)使用show master status 查看File與Position值

  4. 解決方式

  5. 改為正確的bin文件名;

  6. 從庫(kù)中重新使用主從鏈路 change master to …

8. 常見(jiàn)問(wèn)題及處理方法

1. 安裝Mysql8時(shí)提示 VCRUNTIME140.dll錯(cuò)誤

主從復(fù)制修改 master_port: 3306,mysql,數(shù)據(jù)庫(kù)

  • 解決方法

vc++官網(wǎng)下載:https://docs.microsoft.com/zh-CN/cpp/windows/latest-supported-vc-redist?view=msvc-170

  1. X64快速下載地址:https://aka.ms/vs/17/release/vc_redist.x64.exe
  2. X86快速下載地址:https://aka.ms/vs/17/release/vc_redist.x86.exe
  3. ARM64快速下載地址:https://aka.ms/vs/17/release/vc_redist.arm64.exe

原因分析:

  1. 缺少VC_redist.x64_v2015-2022.exe的安裝
  2. 版本號(hào):14.30.30704
  3. 最好下載一個(gè)最新版本,如果安裝MySQL8時(shí)只安裝了VC++2015,則會(huì)提示VCRUNTIME140_1.dll的錯(cuò)誤
    主從復(fù)制修改 master_port: 3306,mysql,數(shù)據(jù)庫(kù)

只安裝了vc++2015,版本為14.0.xxx,則會(huì)提示下面問(wèn)題,所以安裝最高版本的VC++不會(huì)有這種問(wèn)題
主從復(fù)制修改 master_port: 3306,mysql,數(shù)據(jù)庫(kù)

2. 提示沒(méi)有創(chuàng)建目錄的權(quán)限

此問(wèn)題往往是my.ini中的配置錯(cuò)誤導(dǎo)致的,如盤(pán)符指定錯(cuò)誤、安裝位置指定錯(cuò)誤都有可能導(dǎo)致這種問(wèn)題
主從復(fù)制修改 master_port: 3306,mysql,數(shù)據(jù)庫(kù)文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-805807.html


D:\MySqlServer\mysql-8.0.27-winx64\bin>mysqld --initialize --console
mysqld: Can't create directory 'E:\MySqlServer\mysql-8.0.27-winx64\data\' (OS er
rno 13 - Permission denied)
2021-11-29T07:02:16.453126Z 0 [Warning] [MY-010918] [Server] 'default_authentica
tion_plugin' is deprecated and will be removed in a future release. Please use a
uthentication_policy instead.
2021-11-29T07:02:16.453128Z 0 [System] [MY-013169] [Server] D:\MySqlServer\mysql
-8.0.27-winx64\bin\mysqld.exe (mysqld 8.0.27) initializing of server in progress
 as process 2596
2021-11-29T07:02:16.453129Z 0 [ERROR] [MY-010338] [Server] Can't find error-mess
age file 'E:\MySqlServer\mysql-8.0.27-winx64\share\errmsg.sys'. Check error-mess
age file location and 'lc-messages-dir' configuration directive.
2021-11-29T07:02:16.453131Z 0 [ERROR] [MY-013236] [Server] The designated data d
irectory E:\MySqlServer\mysql-8.0.27-winx64\data\ is unusable. You can remove al
l files that the server added to it.
2021-11-29T07:02:16.453132Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-11-29T07:02:16.453134Z 0 [System] [MY-010910] [Server] D:\MySqlServer\mysql
-8.0.27-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.27)  MySQL Communit
y Server - GPL.

D:\MySqlServer\mysql-8.0.27-winx64\bin>

't find error-mess
age file 'E:\MySqlServer\mysql-8.0.27-winx64\share\errmsg.sys'. Check error-mess
age file location and 'lc-messages-dir' configuration directive.
2021-11-29T07:02:16.453131Z 0 [ERROR] [MY-013236] [Server] The designated data d
irectory E:\MySqlServer\mysql-8.0.27-winx64\data\ is unusable. You can remove al
l files that the server added to it.
2021-11-29T07:02:16.453132Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-11-29T07:02:16.453134Z 0 [System] [MY-010910] [Server] D:\MySqlServer\mysql
-8.0.27-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.27)  MySQL Communit
y Server - GPL.

D:\MySqlServer\mysql-8.0.27-winx64\bin>

到了這里,關(guān)于MySQL8主從復(fù)制之一主一從實(shí)戰(zhàn)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶(hù)投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • MySQL - 讀寫(xiě)分離、一主一從、雙主雙從

    MySQL - 讀寫(xiě)分離、一主一從、雙主雙從

    讀寫(xiě)分離 ,簡(jiǎn)單地說(shuō)是把對(duì)數(shù)據(jù)庫(kù)的讀和寫(xiě)操作分開(kāi),以對(duì)應(yīng)不同的數(shù)據(jù)庫(kù)服務(wù)器。主數(shù)據(jù)庫(kù)提供寫(xiě)操作,從數(shù)據(jù)庫(kù)提供讀操作,這樣能有效地減輕單臺(tái)數(shù)據(jù)庫(kù)的壓力。 MyCat實(shí)現(xiàn)讀寫(xiě)分離的話(huà),主要通過(guò)兩個(gè)組件來(lái)實(shí)現(xiàn): ? readHost、writeHost 讀寫(xiě)分離它的前提是基于主從復(fù)制 主

    2024年02月07日
    瀏覽(21)
  • MYSQL8主從復(fù)制

    MYSQL8主從復(fù)制

    關(guān)鍵點(diǎn): 主庫(kù) 創(chuàng)建一個(gè) 遠(yuǎn)程用戶(hù) 并 授予復(fù)制權(quán)限 。 在 主庫(kù) 和 從庫(kù) 的 my.cnf 配置 服務(wù)器唯一id ; 開(kāi)啟 全局事務(wù)ID ; 在 my.cnf 文件中啟用 二進(jìn)制日志 記錄,并為其分配一個(gè) 唯一的服務(wù)器 ID 。 關(guān)閉 主節(jié)點(diǎn) 和 從節(jié)點(diǎn) 的mysql服務(wù)。 主服務(wù)器配置 每個(gè)數(shù)據(jù)庫(kù)實(shí)例的 服務(wù)器ID 要

    2024年02月01日
    瀏覽(38)
  • docker 搭建mysql集群一主一從,兩臺(tái)機(jī)器

    docker 搭建mysql集群一主一從,兩臺(tái)機(jī)器

    一、準(zhǔn)備兩條機(jī)器,分別為IP1和IP2,其中IP1為主,IP2為從 二、在兩臺(tái)機(jī)器上分別拉取mysql鏡像 三、在home目錄下新建目錄,分別為/home/mysql/data,/home/mysql/conf 1、在IP1主機(jī)下的/home/mysql/conf目錄下新建my.cnf文件,內(nèi)容為 2、在IP2從機(jī)的/home/mysql/conf目錄下新建my.cnf文件,內(nèi)容為 四、在

    2024年01月24日
    瀏覽(24)
  • MySQL一主一從、配置一主多從結(jié)構(gòu)、數(shù)據(jù)讀寫(xiě)分離

    部署mysql主從同步 配置mysql主從 分為主數(shù)據(jù)庫(kù)角色(master)、從數(shù)據(jù)庫(kù)服務(wù)器角色(slave) 網(wǎng)站服務(wù)器連接后存儲(chǔ)數(shù)據(jù)的服務(wù)器作為主服務(wù)器 自動(dòng)同步主服務(wù)器上的數(shù)據(jù) 192.168.88.53 做master 啟用binlog日志文件?指定server_id 重啟服務(wù) 用戶(hù)授權(quán) 查看正在使用的binlog日志文件 192.

    2024年01月19日
    瀏覽(23)
  • MySQL8.0.33主從復(fù)制配置記錄

    MySQL8.0.33主從復(fù)制配置記錄

    官網(wǎng):https://dev.mysql.com/downloads/mysql/ 在線(xiàn)下載或者下載到本地再上傳 準(zhǔn)備wget下載工具: 進(jìn)入MySQL的bin目錄 初始化并得到密碼 ./mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory 報(bào)錯(cuò),缺依賴(lài):::: yum install -y libaio yum -y install numactl 再初始

    2024年02月02日
    瀏覽(25)
  • linux系統(tǒng)mysql8單機(jī)多實(shí)例+主從復(fù)制部署

    參考我的另一篇博文,tag.gz解壓完并且配置完環(huán)境變量即可,暫時(shí)不要初始化 linux單機(jī)部署mysql(離線(xiàn)環(huán)境解壓即可)-CSDN博客 可能因?yàn)榘姹静煌业倪@個(gè)配置可能不是通用的, 我安裝的是mysql8.0.34版本。如果我的配置不適用于其他版本,請(qǐng)輸入命令mysqld_multi --example, 參考官方

    2024年01月25日
    瀏覽(19)
  • CentOS7安裝Mysql8并進(jìn)行主從復(fù)制配置

    CentOS7安裝Mysql8并進(jìn)行主從復(fù)制配置

    CentOS7中安裝Mysql8并配置遠(yuǎn)程連接和修改密碼等: CentOS7中安裝Mysql8并配置遠(yuǎn)程連接和修改密碼等_霸道流氓氣質(zhì)的博客-CSDN博客 在上面實(shí)現(xiàn)安裝Mysql8的基礎(chǔ)上,克隆出兩臺(tái)機(jī)器,修改ip后進(jìn)行mysql的主從復(fù)制搭建。 在主庫(kù)上把數(shù)據(jù)更改記錄到二進(jìn)制日志中(Binary Log)中,這些記

    2024年02月16日
    瀏覽(26)
  • 用幾張圖實(shí)戰(zhàn)講解MySQL主從復(fù)制

    本文分享自華為云社區(qū)《結(jié)合實(shí)戰(zhàn),我為MySQL主從復(fù)制總結(jié)了幾張圖!》,作者: 冰 河。 MySQL 主從復(fù)制官方文檔鏈接地址如下所示: http://dev.mysql.com/doc/refman/8.0/en/replication.html MySQL5.6 開(kāi)始主從復(fù)制有兩種方式:基于日志(binlog)、基于 GTID(全局事務(wù)標(biāo)示符)。 這里,我們

    2024年03月09日
    瀏覽(20)
  • MySQL8.0主從部署配置詳細(xì)步驟

    MySQL8.0主從部署配置詳細(xì)步驟

    環(huán)境:CentOS7+MySQL8 hostname ip 角色 c7-lab1 10.10.104.51 主 c7-lab2 10.10.104.52 從 一、安裝MySQL數(shù)據(jù)庫(kù) 1.1、下載mysql8,下載rpm bundle包上傳到centos系統(tǒng)上。官網(wǎng) https://dev.mysql.com/downloads/mysql 或者使用wget命令+鏈接直接下載 1.2、解壓bundle包 1.3、卸載mariadb 1.4、安裝MySQL 安按照下面圖片的順序

    2024年01月16日
    瀏覽(15)
  • docker 安裝mysql8 實(shí)現(xiàn)互為主從

    docker 安裝mysql8 實(shí)現(xiàn)互為主從

    先按照這個(gè)目錄結(jié)構(gòu)創(chuàng)建。 mysql.conf 配置,mysql的基礎(chǔ)可以在此添加 mysql-master下conf配置 mysql-slave下conf配置 ?注意我指定了數(shù)據(jù)庫(kù)為test_db ?注意:我使用的mysql用戶(hù)為默認(rèn)root,可以自行創(chuàng)建其他用戶(hù)訪問(wèn)數(shù)據(jù)庫(kù)。 在mysql文件夾下執(zhí)行 ? 如上圖所示表示mysql創(chuàng)建成功。 獲取主服

    2024年02月22日
    瀏覽(21)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包