• ADADADADAD

    phpmyadmin+mysql-5.6.16.tar.gz使用[ mysql数据库 ]

    mysql数据库 时间:2024-12-25 09:55:20

    作者:文/会员上传

    简介:

    Phpmyadmin的使用首先需要lamp或者是lnmp环境:一.首先搭建phpmyadmin运行环境现在以lamp环境为例:安装部署lamp环境1.安装Apache下载安装yum install zlib-devel -ywget http:

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

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

    一.首先搭建phpmyadmin运行环境

    现在以lamp环境为例:
    安装部署lamp环境

    1.安装Apache
    下载安装

    yum install zlib-devel -ywget http://mirror.bit.edu.cn/apache/httpd/httpd-2.2.31.tar.gztar 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-rewritemakemake installln -s /application/apache2.2.31/ /application/apachels -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.repoyum 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 -yyum install zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel -ymkdir -p /application/toolscd /application/toolswget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar 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.gzcd 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-dirmakemake installln -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_modulemodules/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:802)311 AddType application/x-httpd-php.php .phtmlAddType application/x-httpd-php-source.phps3)用户 (关键是统一UID,工作中web服务统一一套工具)apache和nginx的用户UID是一致的67行下增加User wwwGroup wwwuseradd www -s /sbin/nologin -M建立用户:id www4)166DirectoryIndex 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.gzMv phpMyAdmin-4.0.5-all-languages.tar.gz phpmyadmin 改名

    到此部署完成
    三.演示成果
    在浏览器输入:http://192.168.56.42/phpmyadmin/

    此时的httpd的启动用户为www
    [root@mysql-5 libraries]# lsof -i:80
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    httpd 13442 root4uIPv6 2110120t0TCP :http (LISTEN)
    httpd 13444www4uIPv6 2110120t0TCP
    :http (LISTEN)
    httpd 13445www4uIPv6 2110120t0TCP :http (LISTEN)
    httpd 13446www4uIPv6 2110120t0TCP
    :http (LISTEN)
    注意:
    如果pkill httpd,
    使用/etc/init.d/httpd start启动,则会导致phpmyadmin界面打不开报错404

    此时查看lsof –i:80

    [root@mysql-5 libraries]# lsof -i:80COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEhttpd 13381 root4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13383 apache4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13384 apache4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13385 apache4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13386 apache4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13387 apache4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13388 apache4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13389 apache4uIPv6 2104790t0TCP *:http (LISTEN)httpd 13390 apache4uIPv6 2104790t0TCP *: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)
    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)

    远程登陆数据库:

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

    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'



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

    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
    到此处问题解决

    Phpmyadmin高级应用参考文档
    http://yongxi.blog.51cto.com/2352775/1762609

    phpmyadmin+mysql-5.6.16.tar.gz使用.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: phpmyadminmysqlmi