熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java高級技術 >> 正文

nginx中mysql5.5 編譯安裝

2022-06-13   來源: Java高級技術 
nginx中mysql 編譯安裝 有需要的朋友可參考一下

–withplugins=csvmyisammyisammrgheapinnobase
現在改成 DWITH_INNOBASE_STORAGE_ENGINE=DWITHOUT_INNOBASE_STORAGE_ENGINE=

/usr/local/bin/cmake DCMAKE_INSTALL_PREFIX=/usr/mysql
DMYSQL_DATADIR=/usr/mysql/data
DWITH_MYISAM_STORAGE_ENGINE=
DWITH_ARCHIVE_STORAGE_ENGINE=
DWITHOUT_INNOBASE_STORAGE_ENGINE=
DWITH_BLACKHOLE_STORAGE_ENGINE=
DENABLED_LOCAL_INFILE=
DMYSQL_UNIX_ADDR=/tmp/mysqldsock
DDEFAULT_CHARSET=utf
DDEFAULT_COLLATION=utf_general_ci
DEXTRA_CHARSETS=all
DMYSQL_TCP_PORT=

mysql cmake編譯安裝

安裝所需要系統庫相關庫文件
yum –y install gcc gccc++ gccg autoconf automake zlib* fiex* libxml*
ncursesdevel libmcrypt* libtoolltdldevel*
創建mysql安裝目錄
# mkdir p /usr/local/webserver/mysql/
創建數據存放目錄
# mkdir p /data/mysql/

創建用戶和用戶組與賦予數據存放目錄權限

# groupadd mysql
# useradd g mysql mysql
# chown mysqlmysql R /data/mysql/

安裝cmake(mysql以後是通過cmake來編譯的)
 
# wget
# tar zxvf cmaketargz
# cd cmake
#configure
# make && make install

下載解壓mysql

wget
[root@localhost down]# tar zxvf mysql targz
[root@localhost down]# cd mysql

編譯mysql

cmake DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql/  DMYSQL_DATADIR=/data/mysql  DMYSQL_UNIX_ADDR=/tmp/mysqldsock  DWITH_INNOBASE_STORAGE_ENGINE=  DENABLED_LOCAL_INFILE= DMYSQL_TCP_PORT=  DEXTRA_CHARSETS=all DDEFAULT_CHARSET=utf  DDEFAULT_COLLATION=utfgeneral_ci  DMYSQL_UNIX_ADDR=/ tmp /mysqlsock  DMYSQL_USER=mysql DWITH_DEBUG=
[root@host mysql]# make
[root@host mysql]# make install

復制配置文件

[root@mysql]# cp supportfiles/mymediuf
[root@mysql]# cp supportfiles/mysqlserver /etc/initd/mysqld

[root@mysql]# chmod /etc/initd/mysqld
初始化數據庫

bash scripts/mysql_install_db user=mysql basedir=
/usr/local/webserver/mysql datadir=/data/mysql/

啟動mysql服務

[root@localhost mysql]# /etc/initd/mysqld start
啟動完成之後用ps ef |grep mysql 命令查看是否啟動
/usr/local/webserver/mysql/bin/mysql u root p
通過命令行登錄管理MySQL服務器 初始密碼為空
修改root密碼
mysql>;use mysql ;
mysql>; update user set password=PASSWORD("") where user=root;
mysql>; FLUSH PRIVILEGES;



From:http://tw.wingwit.com/Article/program/Java/gj/201404/30493.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.