File tree 7 files changed +24
-39
lines changed
7 files changed +24
-39
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,12 @@ matrix:
64
64
addons :
65
65
hosts :
66
66
- mysql2gem.example.com
67
- apt :
68
- packages :
69
- - mysql-server-5.7
70
- - mysql-client-core-5.7
71
- - mysql-client-5.7
67
+ # https://github.com/travis-ci/travis-ci/issues/5122
68
+ # apt:
69
+ # packages:
70
+ # - mysql-server-5.7
71
+ # - mysql-client-core-5.7
72
+ # - mysql-client-5.7
72
73
- rvm : 2.0.0
73
74
env : DB=mysql55
74
75
os : osx
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -eu
4
-
5
- service mysql stop
6
- apt-get purge ' ^mysql*' ' libmysql*'
7
- apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x8C718D3B5072E1F5
3
+ set -eux
8
4
5
+ apt-get purge -qq ' ^mysql*' ' ^libmysql*'
6
+ apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
9
7
add-apt-repository ' deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7'
8
+ apt-get update -qq
9
+ apt-get install -qq mysql-server libmysqlclient-dev
10
10
11
- apt-get update
12
- apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew -y install mysql-server libmysqlclient-dev
13
-
14
- mysql_upgrade -u root --force --upgrade-system-tables
15
-
16
- # Replace the final line of the mysql apparmor, allowing /etc/mysql/*.pem
17
- sed -ie ' $ s|}|\
18
- /etc/mysql/*.pem r,\
19
- }|' /etc/apparmor.d/usr.sbin.mysqld
20
- service apparmor restart
11
+ # https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
12
+ mysql -u root -e " ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''"
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -eu
3
+ set -eux
4
4
5
5
# Install MySQL 5.7 if DB=mysql57
6
6
if [[ -n ${DB-} && x$DB =~ ^xmysql57 ]]; then
@@ -20,15 +20,12 @@ if ! [[ x$OSTYPE =~ ^xdarwin ]]; then
20
20
sudo service mysql restart
21
21
fi
22
22
23
- sudo mysql -u root -e " CREATE USER '$USER '@'localhost'" || true
24
- sudo mysql -u root -e " GRANT ALL ON test.* TO '$USER '@'localhost'" || true
25
-
26
23
# Print the MySQL version and create the test DB
27
24
if [[ x$OSTYPE =~ ^xdarwin ]]; then
28
25
$( brew --prefix " $DB " ) /bin/mysqld --version
29
- $( brew --prefix " $DB " ) /bin/mysql -u $USER -e " CREATE DATABASE IF NOT EXISTS test"
26
+ $( brew --prefix " $DB " ) /bin/mysql -u root -e ' CREATE DATABASE IF NOT EXISTS test'
30
27
else
31
28
mysqld --version
32
29
# IF NOT EXISTS is mariadb-10+ only - https://mariadb.com/kb/en/mariadb/comment-syntax/
33
- mysql -u $USER -e " CREATE DATABASE /*M!50701 IF NOT EXISTS */ test"
30
+ mysql -u root -e ' CREATE DATABASE /*M!50701 IF NOT EXISTS */ test'
34
31
fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -eu
3
+ set -eux
4
4
5
5
# Make sure there is an /etc/mysql
6
6
mkdir -p /etc/mysql
Original file line number Diff line number Diff line change 9
9
username: LOCALUSERNAME
10
10
password:
11
11
database: mysql2_test
12
-
13
- numericuser:
14
- host: localhost
15
- username: LOCALUSERNAME
16
- password:
17
- database: 12345
Original file line number Diff line number Diff line change @@ -263,13 +263,14 @@ def run_gc
263
263
end
264
264
265
265
it "should be able to connect to database with numeric-only name" do
266
- creds = DatabaseCredentials [ 'numericuser' ]
267
- @client . query "CREATE DATABASE IF NOT EXISTS `#{ creds [ 'database' ] } `"
268
- @client . query "GRANT ALL ON `#{ creds [ 'database' ] } `.* TO #{ creds [ 'username' ] } @`#{ creds [ 'host' ] } `"
266
+ database = 1235
267
+ @client . query "CREATE DATABASE IF NOT EXISTS `#{ database } `"
269
268
270
- expect { Mysql2 ::Client . new ( creds ) } . not_to raise_error
269
+ expect {
270
+ Mysql2 ::Client . new ( DatabaseCredentials [ 'root' ] . merge ( 'database' => database ) )
271
+ } . not_to raise_error
271
272
272
- @client . query "DROP DATABASE IF EXISTS `#{ creds [ ' database' ] } `"
273
+ @client . query "DROP DATABASE IF EXISTS `#{ database } `"
273
274
end
274
275
275
276
it "should respond to #close" do
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -eu
3
+ set -eux
4
4
5
5
echo "
6
6
[ ca ]
You can’t perform that action at this time.
0 commit comments