|
稀有手游【新征途口袋版】Linux手工服务端+架设教程+服务器部署文档
架设流程简单说明
1、操作系统为Centos6.3_64位,需要安装的包:
lua-5.1.5
cmake-2.8.7
mysql-5.5.23
mysql++-3.1.0
boost_1_49_0
tar -xzvf lua-5.1.5.tar.gz
cd lua-5.1.5
然后执行make,
会提示让你输入make 系统,因为我的系统是linux的,
因此我输入make linux
2、编译安装boost
#tar -zxvf boost_1_49_0.tar.gz
#cd boost_1_49_0
#./bootstrap.sh
#./b2 install
3、MYSQL5.5安装详细步骤:
#tar zxvf cmake-2.8.7.tar.gz -C /usr/local/src/
#tar zxvf mysql-5.5.23.tar.gz -C /usr/local/src/
# cd /usr/local/src/cmake-2.8.7/
# ./configure
# gmake && make install
# cd ../mysql-5.5.23/
# mkdir -p /data/mysql
存放mysql的数据文件的
# useradd -u 27 -d /data/mysql/ -s /sbin/nologin mysql
# id mysql
uid=27(mysql) gid=27(mysql) groups=27(mysql)
# chown -R mysql:mysql /data/mysql/
# ls -ld /data/mysql/
drwxr-xr-x 2 mysql mysql 4096 07-11 03:56 /data/mysql/
# yum install -y ncurses-devel
# rm -f CMakeCache.txt (如果后来用yum安装的ncurses-devel
要执行这步操作,在进行下一步)
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql/ -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DDEFAULT_COLLATION=utf8_general_ci
上面这条超长命令必须在mysql-5.5.11目录中执行!!!
-DCMAKE_INSTALL_PREFIX mysql的安装路径
-DDEFAULT_CHARSET 字符集
-DMYSQL_DATADIR 数据的保存路径
-DMYSQL_TCP_PORT 端口
# make&& make install
# cd /usr/local/mysql/
# ls
bin data include lib mysql-test scripts sql-bench
COPYING docs INSTALL-BINARY man README share support-files
# cd support-files/
# cp my-medium.cnf /etc/my.cnf
生成mysql的配置文件
# pwd
/usr/local/mysql
# cd scripts/
# ls
mysql_install_db
# vim /etc/my.conf
在[mysqld]后面加两行
skip-name-resolve
innodb_flush_log_at_trx_commit = 2
初始化数据库:
# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/
Installing MySQL system tables...
OK
Filling help tables...
OK
# vim /etc/my.cnf
[mysqld]
datadir = /data/mysql 添加,指定数据的保存位置
# pwd
/usr/local/mysql/support-files
# cp mysql.server /etc/init.d/mysqld
复制mysql的启动脚本
# /etc/init.d/mysqld start
# pwd
/usr/local/mysql/bin
# ./mysql
mysql>
# vim /etc/profile
export PATH=/usr/local/mysql/binPATH 添加
# . /etc/profile
启动mysql:
/etc/init.d/mysqld start
chkconfig --add mysqld
chkconfig mysqld on
# mysql
mysql>
9、mysql++安装
tar -zxvf mysql++-3.1.0.tar.gz
cd mysql++-3.1.0
./configure
make
make install
# pwd
/root/mysql++-3.1.0
#vim ssx/genv2.cpp 根据报错在这个文件中找到相应位置添加最下面那条命令
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <string.h>
程序启动报错解决:
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/
mysql> select user,host,password from mysql.user;查看用户信息
+------+------------+-------------------------------------------+
| user | host | password |
+------+------------+-------------------------------------------+
| root | localhost | |
| root | 10-6-3-176 | |
| root | 127.0.0.1 | |
| root | % | |
+------+------------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> set password for root@localhost=password('XXXXXXX');设置root密码
mysql> set password for root@'10-6-6-23'=password('XXXXXXXX');
mysql> grant all on *.* to root@"%" identified by 'XXXXXXXX';授权
mysql> select user,host,password from mysql.user;
+------+------------+-------------------------------------------+
| user | host | password |
+------+------------+-------------------------------------------+
| root | localhost | *C07583ABFCBBCC5D64C9469E28D4861951C5024A |
| root | 10-6-3-176 | *C07583ABFCBBCC5D64C9469E28D4861951C5024A |
| root | 127.0.0.1 | |
| root | % | *4F048907E92401E909B60D4C90426C4D3AEB499D |
+------+------------+-------------------------------------------+
4 rows in set (0.00 sec)
mysql> delete from mysql.user where user='';删除匿名用户
mysql> grant select on uctot.* to 小用户@'%' identified by "XXXXXXXX";授权
mysql> show grants for root@"%";查看用户有那些权限
mysql> grant select on *.* to chinatot@"%" identified by 'XXXXXXXXX';
mysql> flush privileges;
mysql> exit
|
|
上一篇:最新【九州天下】VM一键端+跨服+多区+运营后台+授权GM后台...下一篇:卧龙吟330级修改版
|