Open najoast opened 1 year ago
开2服
DROP DATABASE IF EXISTS `acore_world2`;
CREATE DATABASE `acore_world2` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;
DROP DATABASE IF EXISTS `acore_characters2`;
CREATE DATABASE `acore_characters2` DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON `acore_world2` . * TO 'acore'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `acore_characters2` . * TO 'acore'@'%' WITH GRANT OPTION;
INSERT INTO realmlist
(id
, name
, address
, localAddress
, localSubnetMask
, port
, icon
, flag
, timezone
, allowedSecurityLevel
, population
, gamebuild
) VALUES (2, 'AzerothCore', '127.0.0.1', '127.0.0.1', '255.255.255.0', 8085, 0, 0, 1, 0, 0, 12340);
1 安装所需软件
2 编译
3 服务器设置
~/azeroth-server/data
目录下~/azeroth-server/etc/worldserver.conf.dist
复制一份到~/azeroth-server/etc/worldserver.conf
,然后编辑~/azeroth-server/etc/worldserver.conf
,把DataDir = "."
改成DataDir = "/home/你的用户名/azeroth-server/data"
~/azeroth-server/etc/authserver.conf.dist
复制一份到~/azeroth-server/etc/authserver.conf
4 初始化数据库
执行
sudo mysql
进入数据库的终端执行以下SQL语句,创建acore用户,创建acore_world、acore_characters、acore_auth三个数据库,并授权acore用户拥有这三个数据库的所有权限
GRANT ALL PRIVILEGES ON . TO 'acore'@'%' WITH GRANT OPTION;
DROP DATABASE IF EXISTS
acore_world
; CREATE DATABASEacore_world
DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;DROP DATABASE IF EXISTS
acore_characters
; CREATE DATABASEacore_characters
DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;DROP DATABASE IF EXISTS
acore_auth
; CREATE DATABASEacore_auth
DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_general_ci;GRANT ALL PRIVILEGES ON
acore_world
. TO 'acore'@'%' WITH GRANT OPTION; GRANT ALL PRIVILEGES ONacore_characters
. TO 'acore'@'%' WITH GRANT OPTION; GRANT ALL PRIVILEGES ONacore_auth
. * TO 'acore'@'%' WITH GRANT OPTION;5 网络设置
acore_auth.realmlist
表里的address
字段,改为服务器的公网IP(如果是虚拟机就填虚拟机的IP)6 启动服务器
为了方便,可以把上面两条命令写到一个脚本里,比如
~/azeroth-server/bin/start.sh
,然后执行chmod +x ~/azeroth-server/bin/start.sh
,这样就可以通过~/azeroth-server/bin/start.sh
来启动服务器了。Ubuntu 防火墙打开3724和8085端口
7 关闭服务器
为了方便,可以把上面两条命令写到一个脚本里,比如
~/azeroth-server/bin/stop.sh
,然后执行chmod +x ~/azeroth-server/bin/stop.sh
,这样就可以通过~/azeroth-server/bin/stop.sh
来关闭服务器了。screen 方式启动服务器
参考文档:https://linuxize.com/post/how-to-use-linux-screen/