MySQL数据库平台及管理工具phpmyadmin配置
时间:2007-12-17 来源:kindum
*所需软件mysql-3.22.32.tar.gz和phpMyAdmin-2.3.3pl1-php.tar.bz2
*在172.16.4.101上配置
一、MySQL数据库平台
(一)安装编译mysql-3.22.32.tar.gz 默认安装到 /usr/local目录中
1.将mysql-3.22.32.tar.gz解压到/usr/local/ 目录
#cd /usr/local
#tar zxvf mysql-3.22.32.tar.gz
2.编译与安装
#cd mysql-3.22.32
#./configure
#make
#make install
3.生成系统默认的帐户数据库
#cd /usr/local/bin
#./mysql_install_db
4.测试mysql的运行(启动服务进程)
(1) #cd /usr/local/share/mysql
(2) 修改权限(ls查看后才有权限修改)
#ls
#chmod a+x mysql.server
(3) 测试运行
#./mysql.server start
#Starting mysqld daemon with databases from /usr/local/var
这时使用mysql 客户端连接
mysql
可以直接连接,而不要密码
Welcome to the MySQL monitor. Command end with ;or \g.
Your MySQL connection id is 10 to server version: 3.22.32
Type ‘help’for help
mysql>
5. 修改用户的连接密码 (使用新密码123456,会要求输入密码(旧密码))
#mysqladmin -u root –p password 123456 //123456是新密码
Enter password:a
6. 再一次使用mysql连接( 需要输入密码123456才能连接到服务器)
#mysql -u root -p
Enter password:123456
Welcome to the MySQL monitor. Command end with ;or \g.
Your MySQL connection id is 10 to server version: 3.22.32
Type ‘help’for help
mysql>
7. 把/usr/local/share/mysql/mysql.server 复制一份到 /etc/rc.d/init.d 目录以便系统可以建立启动的项目
#cp /usr/local/share/mysql/mysql.server /etc/rc.d/init.d/mysql
#service mysql start|stop
二、安装管理工具phpmyadmin
1.先安装WEB服务器平台
2 .#cp phpMyAdmin-2.3.3pl1-php.tar.bz2 /usr/local/apache/htdocs
#cd /usr/local/apache/htdocs
#tar Ixvf phpMyAdmin-2.3.3pl1-php.tar.bz2
#mv phpMyAdmin-2.3.3pl1 phpmyadmin
#vi /usr/local/apache/htdocs/phpmyadmin/config.inc.php
修改以下内容:
$cfg['PmaAbsoluteUri'] = 'http://172.16.4.101/phpadmin/';
$cfg['Servers'][$i]['controluser'] = 'root'; // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = '123456'; // access to the "mysql/user"
3.测试
用IE打开网页http://172.16.4.101/ phpadmin/index.php来测试 phpmyadmin的运行