您的位置:首页 > 博客中心 > 数据库 >

我的linux学习之旅:(4)搭建mysql数据库

时间:2022-03-14 04:17

编译安装mysql

 

目标:在mysqlM上编译安装mariadb,并安装wordpress博客程序。mysqlS暂不配置。

操作系统CentOS6.6 x32_64

使用的mariadb版本

 

本机ip设置情况

 

编译安装mariadb的脚本

#!/bin/bash
#
datadir=/mydata/data
etcdir=/etc/mysql
filepath=/usr/local
file=mariadb-5.5.36-linux-x86_64
 
id mysql || useradd -r mysql
[ ! -d $datadir ] && mkdir -p $datadir
[ ! -d $etcdir ] && mkdir $etcdir
chown -R mysql:mysql $datadir
tar xf /root/$file.tar.gz -C $filepath
 
[ -d $filepath/mysql ] || ln -s $filepath/$file $filepath/mysql
cp $filepath/mysql/support-files/my-large.cnf /etc/mysql/my.cnf
# 使用innodb存储引擎
sed -i "s@thread_concurrency = 8@thread_concurrency = 2\ndatadir=`echo $datadir`\ninnodb_file_per_table = on@" /etc/mysql/my.cnf
 
cp $filepath/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqld
echo ‘export PATH=/usr/local/mysql/bin:$PATH‘ > /etc/profile.d/mysqld.sh
cd $filepath/mysql
./scripts/mysql_install_db --datadir=$datadir --user=mysql
 
chkconfig --add mysqld
service mysqld start


 

数据库已工作正常。

 

 

 

创建一个只允许php主机登录使用的用户wpadmin,密码也是wpadmin。

 

查看授权情况。

 

转战到php主机上,解压wordpress

 

修改wordpress目录下的wp-config-sample.php文件,并存为wp-config.php

 

新建目录并复制文件。

 

浏览器访问http://vul.test.com/wp/index.php

ok.最基础的网络实验环境基础已搭建完毕。

 

 

 


本文出自 “” 博客,请务必保留此出处

热门排行

今日推荐

热门手游