mysql 5.6.16.tar.gz_phpmyadmin+mysql-5.6.16.tar.gz使用

Phpmyadmin的使用首先需要lamp或者是lnmp环境:

一.首先搭建phpmyadmin运行环境

现在以lamp环境为例:

安装部署lamp环境

1.安装Apache

下载安装

yum install zlib-devel -y

wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.2.31.tar.gz

tar xf httpd-2.2.31.tar.gz

cd httpd-2.2.31

./configure \

--prefix=/application/apache2.2.31 \

--enable-deflate \

--enable-expires \

--enable-headers \

--enable-modules=most \

--enable-so \

--with-mpm=worker \

--enable-rewrite

make

make install

ln -s /application/apache2.2.31/ /application/apache

ls -l /application/

2、启动服务

/application/apache/bin/apachectl start 启动时会报错,这时,在 vim httpd.conf文件中把98行改为 ServerName localhost:80,再次重启就不再提示报错了。

netstat -lntup|grep httpd

3、配置基于域名的虚拟主机

cd /application/apache/conf/

vim httpd.conf 修改98行

ServerName 127.0.0.1:80 这样修改,第一次启动时,就不提醒错误

4.php快速安装

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

yum install freetype-devel libjpeg-turbo-devel libpng-devel gd-devel libcurl-devel libxslt-devel libmcrypt-devel mhash mhash-devel mcrypt libxslt-devel -y

yum install openssl-devel openssl -y

yum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel -y

mkdir -p /application/tools

cd /application/tools

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar zxvf libiconv-1.14.tar.gz

cd libiconv-1.14

./configure --prefix=/usr/local/libiconv

make

make install

cd ../

tar xf php-5.3.27.tar.gz

cd php-5.3.27

./configure \

--prefix=/application/php-5.3.27 \

--with-apxs2=/application/apache/bin/apxs \

--with-mysql=mysqlnd \

--with-xmlrpc \

--with-openssl \

--with-zlib \

--with-freetype-dir \

--with-gd \

--with-jpeg-dir \

--with-png-dir \

--with-iconv-dir=/usr/local/libiconv \

--enable-short-tags \

--enable-sockets \

--enable-zend-multibyte \

--enable-soap \

--enable-mbstring \

--enable-static \

--enable-gd-native-ttf \

--with-curl \

--with-xsl \

--enable-ftp \

--with-libxml-dir

make

make install

ln -s /application/php-5.3.27 /application/php

\cp /application/tools/php-5.3.27/php.ini-production /application/php/lib/php.ini

检查apache配置文件中是否有

[root@web02 conf]# grep libphp5 /application/apache/conf/httpd.conf

LoadModule php5_module modules/libphp5.so

[root@web02 conf]# ll /application/apache/modules/

total 28980

-rw-r--r--. 1 root root 9280 Oct 29 08:09 httpd.exp

-rwxr-xr-x. 1 root root 29660983 Oct 29 09:46 libphp5.so

二.配置httpd.conf:apache配置文件中针对连接php的设置

vim /application/apache/conf/httpd.conf

1)98 ServerName 127.0.0.1:80

2)311

AddType application/x-httpd-php .php .phtml

AddType application/x-httpd-php-source .phps

3)用户 (关键是统一UID,工作中web服务统一一套工具)

apache和nginx的用户UID是一致的

67行下增加

User www

Group www

useradd www -s /sbin/nologin -M建立用户:

id www

4)166

DirectoryIndex index.php index.html

此处的MySQL是:192.168.56.42,已经编译安装好

上传phpMyAdmin-4.0.5-all-languages.tar.gz到/application/apache2.2.31/htdocs下

解压 tar xf phpMyAdmin-4.0.5-all-languages.tar.gz

Mv phpMyAdmin-4.0.5-all-languages.tar.gz phpmyadmin 改名

dafc9626b6bc3d7711d92335a6f2388b.png

此时的httpd的启动用户为www

[root@mysql-5 libraries]# lsof -i:80

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

httpd 13442 root 4u IPv6 211012 0t0 TCP :http (LISTEN)

httpd 13444 www 4u IPv6 211012 0t0 TCP:http (LISTEN)

httpd 13445 www 4u IPv6 211012 0t0 TCP :http (LISTEN)

httpd 13446 www 4u IPv6 211012 0t0 TCP:http (LISTEN)

注意:

如果pkill httpd,

使用/etc/init.d/httpd start启动,则会导致phpmyadmin界面打不开报错404

e8233e9fd763bd81adbac5201f17449e.png

此时查看lsof –i:80

[root@mysql-5 libraries]# lsof -i:80

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

httpd 13381 root 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13383 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13384 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13385 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13386 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13387 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13388 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13389 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

httpd 13390 apache 4u IPv6 210479 0t0 TCP *:http (LISTEN)

在192.168.56.42服务器上的MySQL服务创建登陆phpmyadmin的用户和密码

mysql> grant all on *.* to phpmyadmin@'192.168.56.%' identified by '123456';

修改配置文件:这样就可以远程登陆192.168.56.0/24网段的phpmyadmin的数据库账户

/application/apache/htdocs/phpmyadmin/libraries/config.default.php

[root@mysql-5 libraries]# cat -n config.default.php|sed -n '746p'

746 $cfg['AllowArbitraryServer'] = true;

在MySQL服务器192.168.56.41上登录数据库操作:

mysql> select * from wjw02.t2;

+----+-------------+

| id | name |

+----+-------------+

| 1 | tomcat |

| 2 | fire |

| 4 | ball |

| 5 | tom |

| 6 | cat |

| 7 | gog |

| 8 | pig |

| 10 | tiger |

| 11 | go |

| 12 | booss |

| 13 | tomcat12 |

| 15 | tomcat1 |

| 17 | tomcat234 |

| 19 | tomcat34456 |

+----+-------------+

14 rows in set (0.01 sec)

b944078f880e0aa1745a62ae06a9e30d.png

8e4f3f96d806bcbe7151598bbcf9ada4.png

mysql> select * from wjw01.t1;

+----+---------+

| id | name |

+----+---------+

| 1 |sansan |

| 2 | bobo |

| 3 | pig |

| 4 | apple |

| 5 | ball |

| 6 | peer |

| 7 | water |

| 9 | tomcat |

+----+---------+

8 rows in set (0.00 sec)

远程登陆数据库:

fd2430aa5d3851dce11cb28e3eb63e9b.png

登陆远程的192.168.56.41上的MySQL服务,查看当前的wjw02库,t2表

33242939dc1a919b8ed550041bc17cec.png

192.168.56.41上登陆MySQL数据库查看表数据:

mysql> select * from wjw02.t2;

+----+-------------+

| id | name |

+----+-------------+

| 1 | tomcat |

| 2 | fire |

| 4 | ball |

| 5 | tom |

| 6 | cat |

| 7 | gog |

| 8 | pig |

| 10 | tiger |

| 11 | go |

| 12 | booss |

| 13 | tomcat12 |

| 15 | tomcat1 |

| 17 | tomcat234 |

| 19 | tomcat34456 |

+----+-------------+

14 rows in set (0.00 sec)

四.报错警告提示解决方法:

[root@mysql-5 libraries]# cat -n config.default.php|sed -n '160p'

160 $cfg['Servers'][$i]['extension'] = 'mysqli';

修改为:160 $cfg['Servers'][$i]['extension'] = 'mysql'

47c09edd6d389cdee580900832fd6aab.png

b415fa1f1470a7a9fa9ef2a79f31e23c.png

在配置文件102处添加短密码123456,就不会在提示错误了:

59536d8af8ef1c3d421cc4954d30fb1f.png

root@mysql-5 libraries]# cat -n config.default.php|sed -n '102p'

102 $cfg['blowfish_secret'] = '123456';

五.解决缺少mcrypt扩展的问题的办法

参考网友文档:

http://blog.sina.com.cn/s/blog_4d0309640101ju0j.html

下面以CentOS 6.0系统为例来为说明

1、安装第三方yum源(默认yum源里面没有这几个库文件,不能使用yum安装)执行以下命令

wget http://www.atomicorp.com/installers/atomic

执行以下命令

sh ./atomic

2、执行以下命令来安装

yum install php-mcrypt libmcrypt libmcrypt-devel

3、重启系统执行

shutdown -r now

记得还需重启一下mysql ,大功告成 登陆phpmyadmin将不再出现缺少mcrypt扩展。请检查PHP配置!

重新启动Apache

/application/apache/bin/apachectl start

lsof -i:80

到此处问题解决

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值