安装MySQL和phpMyAdmin记

2014-11-24 17:52:33 · 作者: · 浏览: 1

安装phpMyAdmin,遇到几个问题,记录一下要点:


安装phpMyAdmin
解压到/var/www
配置Apache
Listen 8030

DocumentRoot /var/www/phpMyAdmin


cp config.sample.inc.php config.inc.php
vi config.inc.php
修改以下段
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = false;


连接多个host,复制上面一段,改变一下$cfg['Servers'][$i]['host']即可,
在登录的时候会多亿个host选择框。


重启apache
service httpd restart


MySQL安装
./configure && make && make install
安装基本库
scripts/mysql_install_db
[按提示设置root密码]


选择配置文件
cp support-files/my-huge.cnf /etc/my.cnf
vi /etc/my.cnf 增加以下内容
[client]
default-character-set=utf8
default-character-set=utf8
[mysqld]
datadir = /opt/mysql_data
default-character-set=utf8


增加mysql用户
adduser mysql


赋权限给mysql用户
chown -R mysql.mysql /opt/mysql_data


设置自启动
cp support-files/mysql.server /etc/init.d/mysql
赋执行权限
chomd +x /etc/init.d/mysql


启动mysql
service mysql restart