大家好,小编是个电脑软件控,phpMyAdmin是一个Web界面,通过它可以管理你的MySQL数据库。那么怎么在CentOS 6.0安装phpMyAdmin呢?本文我们就来介绍这一安装过程,希望能够对您有所帮助。
phpMyAdmin在CENTOS6.0中简单的安装步骤教程图1
首先,我们使我们的CentOS系统的RPMForge软件库phpMyAdmin,不是官方的CentOS 6.0库,导入rpmforge的GPG密钥:
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
x86_64 系统安装命令:
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
i386 系统安装命令:
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
现在可以安装phpMyAdmin如下:
yum install phpmyadmin
现在,我们配置phpMyAdmin。改变Apache的配置,使phpMyAdmin连接,而不仅仅是从localhost(注释掉允许) :
vi /etc/httpd/conf.d/phpmyadmin.conf
#
# Web application to manage MySQL
#
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin
下一步,我们改变在phpMyAdmin的身份验证cookie ,HTTP:
vi /usr/share/phpmyadmin/config.inc.php[...]
/* Authentication type */
$cfg[\\\'Servers\\\'][$i][\\\'auth_type\\\'] = ‘http’;
[...]
phpMyAdmin在CENTOS6.0中简单的安装步骤教程图2
重新启动Apache:
/etc/init.d/httpd restart
之后,您可以根据访问phpMyAdmin http://192.168.0.100/phpmyadmin/管理数据库了。
mysql从5.5之后源码装置需求运用cmake:
To install MySQL from source,your system must have the following tools,regardless of installation method:
CMake,which is used as the build framework on all platforms.CMake can be downloaded fromhttp://www.cmake.org.
A good make program. Although some platforms come with their ownmake implementations,it is highly recommended that you use GNUmake 3.75 or newer. It may already be available on your system asgmake. GNUmake is available fromhttp://www.gnu.org/software/make/.
A working ANSI C++ compiler. GCC 4.2.1 or later,Sun Studio 10 or later,Visual Studio 2008 or later,and many current vendor-supplied compilers are known to work.
Perl is needed if you intend to run test scripts. Most Unix-like systems include Perl. On Windows,you can use a version such as ActiveState Perl.
yum 装置 gcc,gcc-c++,cmake,bison(GNU),运用 centos6.0 自带的perl和openssl
增加mysql组和mysql用户
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
将mysql和data文件装置到不同的物理磁盘上
cmake -DCMAKE_INSTALL_PREFIX=/opt/soft/mysql \\\\\\\\
-DMYSQL_DATADIR=/home/soft/mysql/data \\\\\\\\
-DMYSQL_UNIX_ADDR=/opt/soft/mysql/mysql.sock \\\\\\\\
-DMYSQL_TCP_PORT=3306 \\\\\\\\
-DDEFAULT_CHARSET=utf8 \\\\\\\\
-DDEFAULT_COLLATION=utf8_general_ci \\\\\\\\
-DEXTRA_CHARSETS=all \\\\\\\\
-DWITH_EMBEDDED_SERVER=0 \\\\\\\\
-DWITH_MYISAM_STORAGE_ENGINE=1 \\\\\\\\
-DWITH_INNOBASE_STORAGE_ENGINE=1 \\\\\\\\
-DWITH_MEMORY_STORAGE_ENGINE=1 \\\\\\\\
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \\\\\\\\
-DWITH_READLINE=1 \\\\\\\\
-DENABLED_LOCAL_INFILE=1 \\\\\\\\
-DMYSQL_USER=mysql \\\\\\\\
-DWITH_DEBUG=0 \\\\\\\\
-DWITH_SSL=yes
phpMyAdmin在CENTOS6.0中简单的安装步骤教程图3
报错:
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu ,package name is libncurses5-dev ,
on RedHat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:126 (FIND_CURSES)
cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:256 (MYSQL_CHECK_READLINE)
-- Configuring incomplete,errors occurred!
=======================
没有装置 ncurses-devel
yum装置之后 还是报错,找运维高手才知道 cmake会产生CMakeCache.txt文件,每次cmake之前需求删除它....
ok,一切正常
echo $?
输出成果为0
make
make install
装置成功
chown mysql:mysql /home/soft/mysql -R
chown msyql:mysql /opt/soft/mysql/ -R
初始化数据库
/opt/soft/mysql/scripts/mysql_install_db \\\\\\\\--defaults-file=/opt/soft/mysql/config/my.cnf \\\\\\\\ --basedir=/opt/soft/mysql\\\\\\\\ --datadir=/home/soft/mysql/data \\\\\\\\ --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system