Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
167 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[ | ||
{"host": "localhost", "unix_socket": "/var/run/mysqld/mysqld.sock", "user": "root", "passwd": "", "db": "test_pymysql", "use_unicode": true, "local_infile": true}, | ||
{"host": "localhost", "port": 3306, "user": "root", "passwd": "", "db": "test_pymysql2" } | ||
{"host": "127.0.0.1", "port": 3306, "user": "travis_pymysql2", "password": "some password", "db": "test_pymysql2" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/bin/bash | ||
|
||
#debug | ||
set -x | ||
#verbose | ||
set -v | ||
|
||
if [ ! -z "${DB}" ]; then | ||
# disable existing database server in case of accidential connection | ||
mysql -u root -e 'drop user travis@localhost; drop user root@localhost; drop user travis; create user super@localhost; grant all on *.* to super@localhost with grant option' | ||
mysql -u super -e 'drop user root' | ||
F=mysql-${DB}-linux-glibc2.5-x86_64 | ||
mkdir -p ${HOME}/mysql | ||
P=${HOME}/mysql/${F} | ||
if [ ! -d "${P}" ]; then | ||
wget http://cdn.mysql.com/Downloads/MySQL-${DB%.*}/${F}.tar.gz -O - | tar -zxf - --directory=${HOME}/mysql | ||
fi | ||
if [ -f "${P}"/my.cnf ]; then | ||
O="--defaults-file=${P}/my.cnf" | ||
fi | ||
if [ -x "${P}"/scripts/mysql_install_db ]; then | ||
I=${P}/scripts/mysql_install_db | ||
O="--defaults-file=${P}/my.cnf" | ||
else | ||
I=${P}/bin/mysqld | ||
IO=" --initialize " | ||
O="--no-defaults " | ||
fi | ||
${I} ${O} ${IO} --basedir=${P} --datadir=${HOME}/db-"${DB}" --log-error=/tmp/mysql.err | ||
PWLINE=$(grep 'A temporary password is generated for root@localhost:' /tmp/mysql.err) | ||
PASSWD=${PWLINE##* } | ||
if [ -x ${P}/bin/mysql_ssl_rsa_setup ]; then | ||
${P}/bin/mysql_ssl_rsa_setup --datadir=${HOME}/db-"${DB}" | ||
fi | ||
# sha256 password auth keys: | ||
openssl genrsa -out "${P}"/private_key.pem 2048 | ||
openssl rsa -in "${P}"/private_key.pem -pubout -out "${P}"/public_key.pem | ||
${P}/bin/mysqld_safe ${O} --ledir=/ --mysqld=${P}/bin/mysqld --datadir=${HOME}/db-${DB} --socket=/tmp/mysql.sock --port 3307 --innodb-buffer-pool-size=200M --lc-messages-dir=${P}/share --plugin-dir=${P}/lib/plugin/ --log-error=/tmp/mysql.err & | ||
while [ ! -S /tmp/mysql.sock ]; do | ||
sleep 2 | ||
done | ||
cat /tmp/mysql.err | ||
if [ ! -z "${PASSWD}" ]; then | ||
${P}/bin/mysql -S /tmp/mysql.sock -u root -p"${PASSWD}" --connect-expired-password -e "SET PASSWORD = PASSWORD('')" | ||
fi | ||
mysql -S /tmp/mysql.sock -u root -e "create user ${USER}@localhost; create user ${USER}@'%'; grant all on *.* to ${USER}@localhost WITH GRANT OPTION;grant all on *.* to ${USER}@'%' WITH GRANT OPTION;" | ||
sed -e 's/3306/3307/g' -e 's:/var/run/mysqld/mysqld.sock:/tmp/mysql.sock:g' .travis.databases.json > pymysql/tests/databases.json | ||
echo -e "[client]\nsocket = /tmp/mysql.sock\n" > "${HOME}"/.my.cnf | ||
else | ||
cp .travis.databases.json pymysql/tests/databases.json | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters