在进行本文档操作前,需要完成如下前期步骤:
1.
备注:RedMine部署在Ubuntu+Mysql环境下
Ubuntu
Mysql版本:5.1.41-3ubuntu12
2.
备注:部署系统中TestLink的Release需为1.8.0后版本。
1.
2.
3.
4.
配置文件包括:
?
?
5.
1.
sudo ufw disable
设置Mysql远程连接账户1.
2.
root@redmine:~# mysql -u root –p
Enter password:
3.
mysql>use mysql;
4.
mysql> GRANT ALL PRIVILEGES ON new_user.* TO remote@"%" IDENTIFIED BY "new_user_password"
说明:其中new_user为远程登录用户名,new_user_password为远程登录用户密码。其中”%”说明对允许那台主机能够远程连接RedMine服务器的数据库。
以上信息在部署过程中,根据实际情况进行设置,本文档部署过程中,www.linuxidc.com 远程登录用户名为设为remote,所有主机均可连接至RedMine服务器的数据库。
5.
root@redmine sudo vi /etc/mysql/my.cnf
在旧版本中找到 skip-networking,把它注释掉就可以了
#skip-networking
在新版本中:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address
bind-address
#bind-address
或者把允许访问的 ip 填上
#bind-address
然后重启 MySQL
root@redmine sudo /etc/init.d/mysql restart
* Starting MySQL database server mysqld
* Checking for corrupt, not cleanly closed and upgrade needing tables.
andy@ubuntu:~$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld
远程登录账户验证,有两种方式。
方式1:
1.
C:\xampp\mysql\bin>mysql -h 10.7.1.88 -u root -p
Enter password: *******
Welcome to the MySQL monitor.
Your MySQL connection id is 377
Server version: 5.1.41-3ubuntu12 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
出现mysql>标示测试通过。
方式2:
通过编写test.php页面,测试连通性。
<?
$link=mysql_connect('10.7.1.88','remote','******');
if(!$link){
echo "fail";
}
else{
echo "success";
}
mysql_close();
?>
说明:其中'10.7.1.88'为RedMine服务器MySql数据库的IP地址,'remote','******'为远程登录账号及密码。
将test.php放在xampp根目录下,通过http://localhost/test.php进行测试,如通过,则会出现success。
备注:如出现10061错误,是无法连接至数据库的提示信息。
此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/59315.html