数据库

位置:IT落伍者 >> 数据库 >> 浏览文章

nginx中mysql5.5 编译安装


发布日期:2018年07月23日
 
nginx中mysql5.5 编译安装
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;

  

               

上一篇:如何安装SQL Server 2008 Management Studio Express

下一篇:.htaccess图片防盗链