不了解jenkins ci是如何构建的

时间:2012-02-17 09:00:52

标签: mysql bash continuous-integration jenkins

我在jenkins中有我的项目,当你构建它时,它会找到脚本/ cibuild脚本并执行你在那里拥有的任何东西。我从我的项目目录运行脚本,一切都很好,我从jenkins运行构建,我得到错误?我不明白?

我的脚本/ cibuild脚本:

#!/bin/sh   
# This script file is the entry point to ci.miranetworks.net build/test process.
# It is executed by jenkins, from the root directory
#

echo "1. cd into script "
cd script
echo "2. run createmysqldb test_traffic test_user password"
./createmysqldb test_traffic test_user password
echo "3. cd back into root dir "
cd ..
echo "4. create table with sql with: "
mysql -u test_user --password=password test_traffic < ./phoenix/data/sql/lib.model.schema.sql

export WORKSPACE=phoenix
export SYMFONY=$WORKSPACE/lib/vendor/symfony/lib
(cd $WORKSPACE
  echo "6. Clearing the cache"
  ./symfony cc
  echo "7. Run unit test"
  ./symfony php test/unit/RbcTest.php
)

echo "8. All done and exiting"
exit 0

所以当我使用mysql -u test_user --password = password test_traffic登录mysql命令时,它是成功的,然后我做了GRANT ALL,我也得到了:

 ERROR 1045 (28000): Access denied for user 'test_user'@'localhost' (using password: YES)

虽然在createmysqldb中我做:Q2 =“全部开启 TO'$ 2'@'localhost'标识为'$ 3';”

任何人都可以解释为什么我被拒绝访问? 我有另一个问题与相同的脚本,但想要先解决这个问题:)

感谢

1 个答案:

答案 0 :(得分:0)

就MySQL而言,我知道你需要改变

ALL ON . TO ...

ALL ON .* TO ...

授予对所有表的访问权限?