#strip可执行文件
strip /usr/local/mysql/libexec/mysqld
#添加LIB PATH
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf && ldconfig
#将my.cnf文件cp到/etc目录下
cp support-files/my-huge.cnf /etc/my.cnf
#修改my.cnf
datadir=/db/mysql
#创建数据库存放路径
mkdir /db
chown mysql.mysql /db -R
#初始化Mysql表
su - mysql -c "mysql_install_db"
#启动服务器
su - mysql -c "mysqld_safe --skip-name-resolve --open-files-limit=4096&"
#创建数据库和用户
GRANT ALL PRIVILEGES ON *.* TO ztgame@'192.168.104.%' IDENTIFIED BY '' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO ztgame@'localhost' IDENTIFIED BY '' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO ztgame@'218.80.198.234' IDENTIFIED BY '' WITH GRANT OPTION;
4、数据库配置
用mysql进入,然后用create database dbname创建数据库。分别创建SuperServer、RecordServer、Bill数据库,然后用安装包目录下的*.sql的文件建立相应的表。(SessionServer.sql也导入到RecordServer库中)。
在SuperServer数据库SERVERLIST表内添加服务器配置信息。
例子:
INSERT INTO `SERVERLIST` VALUES (1,1,'SuperServer','192.168.104.109',10000,'192.168.104.109',10000);
INSERT INTO `SERVERLIST` VALUES(20,20,'SessionServer','192.168.104.109',6000,'192.168.104.109',6000);
INSERT INTO `SERVERLIST` VALUES(21,21,'SceneServer','192.168.104.104',6010,'192.168.104.104',6010);
INSERT INTO `SERVERLIST` VALUES(22,21,'SceneServer','192.168.104.105',6011,'192.168.104.105',6011);
INSERT INTO `SERVERLIST` VALUES(23,21,'SceneServer','192.168.104.106',6012,'192.168.104.106',6012);
INSERT INTO `SERVERLIST` VALUES(24,21,'SceneServer','192.168.104.107',6013,'192.168.104.107',6013);
INSERT INTO `SERVERLIST` VALUES(25,21,'SceneServer','192.168.104.108',6014,'192.168.104.108',6014);
INSERT INTO `SERVERLIST` VALUES(2200,22,'GatewayServer','192.168.104.100',6020,'210.51.23.132',6020);
INSERT INTO `SERVERLIST` VALUES(2201,22,'GatewayServer','192.168.104.101',6020,'210.51.23.133',6020);
INSERT INTO `SERVERLIST` VALUES(2202,22,'GatewayServer','192.168.104.102',6020,'210.51.23.134',6020);
INSERT INTO `SERVERLIST` VALUES(2203,22,'GatewayServer','192.168.104.103',6020,'210.51.23.135',6020);
INSERT INTO `SERVERLIST` VALUES(11,11,'RecordServer','192.168.104.109',7010,'192.168.104.109',7010);
INSERT INTO `SERVERLIST` VALUES(12,12,'BillServer','192.168.104.109',7020,'192.168.104.109',7020);
在RecordServer数据库上初始化某些表格,目前有ANSWER,TECH,COUNTRY,NPCDARE,ACCPRIV。
IXDBA.NET社区论坛
数据库服务器上跑SuperServer、SessionServer、RecordServer、BillServer四个服务,4个网关服务器分别跑4个网关服务,5个场景服务器分别跑5个场景服务。场景服务器对应的ID就是国家配置的ID号,这个ID号决定场景服务器上面跑几个国家。