简体   繁体   English

mysql:无法使用 mysqld 创建辅助服务器实例

[英]mysql : unable to create secondary server instance using mysqld

I am using mysqld to create an new server along with the existing one[ MYSQL 8.0.27 installed with the windows installer] to test data replication我正在使用 mysqld 与现有服务器一起创建一个新服务器 [MYSQL 8.0.27 安装了 windows 安装程序] 以测试数据复制

I already have an instance of the server installed [called Mysql80] which is the original server and i am trying to create another server called MyTest using mysqld by reading this documentation which seems simple enough我已经安装了一个服务器实例 [称为 Mysql80],它是原始服务器,我正在尝试通过阅读这个看起来很简单的文档来使用 mysqld 创建另一个名为 MyTest 的服务器

i have created an empty Data directory to hold my new database and my configuration file for the server is saved as conf.cnf我创建了一个空的数据目录来保存我的新数据库,并且我的服务器配置文件保存为 conf.cnf

[MyTest]
port = 3310
datadir = E:/Program Files/Developer/MYSQL/Data/TestFolder/Data

from the windows command line i create the server using their exact instructions从 windows 命令行 我使用他们的确切说明创建服务器

mysqld  --defaults-file=E:/conf.cnf  --console

--console is used to display debugging information but i always get these error's --console 用于显示调试信息,但我总是得到这些错误

021-12-12T17:17:11.844725Z 0 [System] [MY-010116] [Server] E:\Program Files\Developer\MYSQL\Server 8.0\bin\mysqld.exe (mysqld 8.0.27) starting as process 2328
2021-12-12T17:17:11.875406Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-12-12T17:17:13.498780Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Table 'mysql.plugin' doesn't exist
2021-12-12T17:17:13.866706Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2021-12-12T17:17:13.867207Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.867617Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.868042Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.868519Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.868926Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.869354Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.869707Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2021-12-12T17:17:13.979431Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-12-12T17:17:14.140027Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-12-12T17:17:14.172455Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2021-12-12T17:17:14.172592Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2021-12-12T17:17:14.175122Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-12-12T17:17:14.175319Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-12-12T17:17:14.176633Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Only one usage of each socket address (protocol/netwo k address/port) is normally permitted.
2021-12-12T17:17:14.176755Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-12-12T17:17:14.177195Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-12-12T17:17:15.446688Z 0 [System] [MY-010910] [Server] E:\Program Files\Developer\MYSQL\Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.27)  MySQL Community Server - GPL.

Ignoring the optimizer error's and cannot find table error's the server always tries to start on port 3306 even though i have specified in my conf file it should be on port 3310忽略优化器错误并且找不到表错误,服务器总是尝试在端口 3306 上启动,即使我在我的 conf 文件中指定它应该在端口 3310 上

Which makes me believe that i typed the config file in the wrong format or i haven't specified enough parameters for the job这让我相信我以错误的格式输入了配置文件,或者我没有为作业指定足够的参数

any ideas?有任何想法吗?

Turns out i was doing two things wrong原来我做错了两件事

  1. I had previously upgraded from mysql 8 to 8.27 hence tables were corrupted which explained the Optimization errors我之前已从 mysql 8 升级到 8.27,因此表已损坏,这解释了优化错误

  2. My config wasn't in the correct format我的配置格式不正确

After deleting the MySQL service from windows services and deleting my data directory these 3 steps need to be performed in order从 windows 服务中删除 MySQL 服务并删除我的数据目录后,需要按顺序执行这 3 个步骤

  1. Create an new directory to store Data, your config file, upload directory[To Use commands like LOAD FILE]创建一个新目录来存储数据、配置文件、上传目录[使用 LOAD FILE 等命令]

The structure looks like this结构看起来像这样

->Warehouse1
 |--->Data
 |--->Uploads
 |--->MyConfig.cnf

Where MyConfig.cnf looks as follows MyConfig.cnf 如下所示

[mysqld]
basedir="E:\Program Files\Developer\MYSQL\Server 8.0"
port=3306
datadir="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\Data"
secure-file-priv="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\Uploads" 

2)Initialize the data directory from your windows command line using mysqld as follows 2)使用mysqld从windows命令行初始化数据目录,如下所示

mysqld --defaults-file="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\config.cnf" --initialize

3)Finally create an service which you can change in Windows Services window 3)最后创建一个你可以在 Windows Services window 中更改的服务

mysqld --install MySQL81  --defaults-file="E:\Program Files\Developer\MYSQL\Storage\WareHouse1\config.cnf"

Repeat the same steps to create an second server.重复相同的步骤来创建第二个服务器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Ubuntu中安装MySQL时出错-无法找到包mysqld-server - Error installing mySQL in ubuntu - unable to locate package mysqld-server 更新后,MySQL服务器将不会从使用“ mysqld”的终端启动 - MySQL server will not start from the teminal using 'mysqld' after update MySQL服务器命令mysqld无法正常工作 - MySQL Server command mysqld is not working 停止 MySQL 数据库服务器:mysqld 失败 - Stopping MySQL database server: mysqld failed mysql 服务器崩溃 -mysqld 得到信号 6 - mysql server crashed -mysqld got signal 6 启动 MySQL 数据库服务器 mysqld [失败] - Starting MySQL database server mysqld [fail] mysql错误“无法通过套接字'/var/run/mysqld/mysqld.sock连接到本地MySQL服务器” - mysql error “Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock” Rails应用程序无法连接到mysql,无法通过socket'/var/run/mysqld/mysql.sock'连接到本地MySQL服务器(2)(Mysql2 :: Error) - Rails application unable to connect to mysql, Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2) (Mysql2::Error) 无法通过ubuntu 14.04中的套接字'/var/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器 - Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in ubuntu 14.04 “无法通过套接字'/var/run/mysqld/mysqld.sock'(2)连接到本地MySQL服务器”) - “Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)”)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM