|
稀有手游【新征途口袋版】Linux手工服務(wù)端+架設(shè)教程+服務(wù)器部署文檔
架設(shè)流程簡單說明
1,、操作系統(tǒng)為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
然后執(zhí)行make,,
會(huì)提示讓你輸入make 系統(tǒng),,因?yàn)槲业南到y(tǒng)是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安裝詳細(xì)步驟:
#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的數(shù)據(jù)文件的
# 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
要執(zhí)行這步操作,在進(jìn)行下一步)
# 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目錄中執(zhí)行!??!
-DCMAKE_INSTALL_PREFIX mysql的安裝路徑
-DDEFAULT_CHARSET 字符集
-DMYSQL_DATADIR 數(shù)據(jù)的保存路徑
-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
初始化數(shù)據(jù)庫:
# ./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 添加,指定數(shù)據(jù)的保存位置
# pwd
/usr/local/mysql/support-files
# cp mysql.server /etc/init.d/mysqld
復(fù)制mysql的啟動(dòng)腳本
# /etc/init.d/mysqld start
# pwd
/usr/local/mysql/bin
# ./mysql
mysql>
# vim /etc/profile
export PATH=/usr/local/mysql/binPATH 添加
# . /etc/profile
啟動(dòng)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 根據(jù)報(bào)錯(cuò)在這個(gè)文件中找到相應(yīng)位置添加最下面那條命令
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <string.h>
程序啟動(dòng)報(bào)錯(cuò)解決:
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');設(shè)置root密碼
mysql> set password for root@'10-6-6-23'=password('XXXXXXXX');
mysql> grant all on *.* to root@"%" identified by 'XXXXXXXX';授權(quán)
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";授權(quán)
mysql> show grants for root@"%";查看用戶有那些權(quán)限
mysql> grant select on *.* to chinatot@"%" identified by 'XXXXXXXXX';
mysql> flush privileges;
mysql> exit
43D90C3B-00B1-4593-AD2B-A36A3B0E0AAD.png (598.12 KB)
下載附件
2020-8-31 17:45 上傳
|
|
免責(zé)聲明,,請(qǐng)仔細(xì)閱讀
1、本站資源內(nèi)容均搜集于互聯(lián)網(wǎng),,版權(quán)歸原著所有,,嚴(yán)禁商用或用于違法用途,由此引發(fā)的法律糾紛及連帶責(zé)任本站概不承擔(dān),!
2,、本站因資源繁多且資源內(nèi)容結(jié)構(gòu)復(fù)雜,所以無法確保資源內(nèi)容的準(zhǔn)確性與完整性還有安全性,!
3,、訪問和使用本站的條件是必須接受本站“ 免責(zé)聲明”,如果不遵守,,請(qǐng)勿訪問或使用本網(wǎng)站,!
4、本網(wǎng)站若無意中侵犯了您的合法權(quán)益,,請(qǐng)來信站長信箱: [email protected],,本站將立即處理!
上一篇:最新【九州天下】VM一鍵端+跨服+多區(qū)+運(yùn)營后臺(tái)+授權(quán)GM后臺(tái)...下一篇:臥龍吟330級(jí)修改版
|