Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-mysqlbackend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-mysqlbackend
Commits
4cc258e9
Unverified
Commit
4cc258e9
authored
5 years ago
by
Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a few typos and style changes.
parent
93b46c1a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README_SETUP.md
+11
-11
11 additions, 11 deletions
README_SETUP.md
configure
+1
-1
1 addition, 1 deletion
configure
tests/test_utils.sh
+8
-11
8 additions, 11 deletions
tests/test_utils.sh
utils/backup.sh
+7
-7
7 additions, 7 deletions
utils/backup.sh
with
27 additions
and
30 deletions
README_SETUP.md
+
11
−
11
View file @
4cc258e9
...
@@ -6,18 +6,18 @@
...
@@ -6,18 +6,18 @@
-
make
-
make
## Create the configuration
## Create the configuration
*
Create an empty
`.config`
file. For the default values and the meaning of
these default
*
Create an empty
`.config`
file. For the default values and the meaning of
values see
[
config.defaults
](
config.defaults
)
. For each
parameter that you
these default
values see
[
config.defaults
](
config.defaults
)
.
For each
want to change, add a corresponding line in your
`.config`
file. You probably
parameter that you
want to change, add a corresponding line in your
`.config`
want to change the passwords. As
plain
password are stored
in the
`.config`
file,
file. You probably
want to change the passwords.
As
the
password
s
are stored
make sure nobody else can read it.
unencrypted in the
`.config`
file,
make sure nobody else can read it.
*
If there is no
`mysql-config-editor`
(
`MySQL 5.5`
. and
`MariaDB`
) then the
*
If there is no
`mysql-config-editor`
(
`MySQL 5.5`
. and
`MariaDB`
) then the
user is needs to provide the
`MYSQL_USER_PASSWORD`
, that is the password of
`MYSQL_USER_PASSWORD`
must be provided
, that is the password of
the
the
`MYSQL_USER`
.
`MYSQL_USER`
.
*
If you are using MariaDB and the
`root`
database user uses pam
authentication,
*
If you are using MariaDB and the
`root`
database user uses pam
no pasword string is required. You can set the
`MYSQL_USER_PASSWORD`
authentication,
no pasword string is required.
You can set the
to an empty string. But you need to be logged in as
root for the
`MYSQL_USER_PASSWORD`
to an empty string.
But you need to be logged in as
installation and upgrade process.
root for the
installation and upgrade process.
## Setup the SQL database for CaosDB
## Setup the SQL database for CaosDB
...
...
This diff is collapsed.
Click to expand it.
configure
+
1
−
1
View file @
4cc258e9
...
@@ -24,6 +24,6 @@
...
@@ -24,6 +24,6 @@
# Do to the new way environment variables are handled and how config files are
# Do to the new way environment variables are handled and how config files are
# read, this file is obsolete
# read, this file is obsolete
echo
"CURRENTLY NOT SUPPORTE
T
"
echo
"CURRENTLY NOT SUPPORTE
D
"
exit
1
exit
1
This diff is collapsed.
Click to expand it.
tests/test_utils.sh
+
8
−
11
View file @
4cc258e9
...
@@ -43,19 +43,17 @@ echo -n 'size of database... '
...
@@ -43,19 +43,17 @@ echo -n 'size of database... '
# check size of database
# check size of database
num
=
$(
mysql_execute
"SELECT COUNT(*) FROM entities"
|
sed
's/COUNT(\*)//'
)
num
=
$(
mysql_execute
"SELECT COUNT(*) FROM entities"
|
sed
's/COUNT(\*)//'
)
if
[
$num
-gt
$MAX_ENTITIES
]
;
then
if
[
$num
-gt
$MAX_ENTITIES
]
;
then
echo
"There are more than
$MAX_ENTITIES
entities...
"
\
failure
"There are more than
$MAX_ENTITIES
entities...
"
\
"Do not run this on a production instance!"
"Do not run this on a production instance!"
exit
1
elif
[
$num
-lt
5
]
;
then
elif
[
$num
-lt
5
]
;
then
echo
"There are less than 5 entities...
"
\
failure
"There are less than 5 entities...
"
\
"Please use this with a database with some example content!"
"Please use this with a database with some example content!"
exit
1
fi
fi
echo
'[Ok]'
echo
'[Ok]'
###############################################################################
###############################################################################
# Below we create a dump, then run tests, and create a dump again. Afterwards
# Below we create a dump, then run tests, and create a dump again. Afterwards
# the dumps are checked if they are not empty and whether they differ.
# the dumps are checked if they are not empty and whether they differ.
# This should make sure that tests interfere somehow with the real database.
# This should make sure that tests interfere somehow with the real database.
# This also provides a very basic test that sql dumps work.
# This also provides a very basic test that sql dumps work.
###############################################################################
###############################################################################
...
@@ -63,8 +61,7 @@ echo '[Ok]'
...
@@ -63,8 +61,7 @@ echo '[Ok]'
# creating a dump of current db
# creating a dump of current db
backupdir
=
$(
realpath
'tmp_backup'
)
backupdir
=
$(
realpath
'tmp_backup'
)
if
[
-e
"
$backupdir
"
]
;
then
if
[
-e
"
$backupdir
"
]
;
then
echo
"Temporary directory
$backupdir
already exists. Please remove it"
failure
"Temporary directory
$backupdir
already exists. Please remove it"
exit
1
fi
fi
echo
-n
'creating initial dump... '
echo
-n
'creating initial dump... '
BACKUPDIR
=
$backupdir
$UTILSPATH
/backup.sh
>
/dev/null
BACKUPDIR
=
$backupdir
$UTILSPATH
/backup.sh
>
/dev/null
...
@@ -90,10 +87,10 @@ done
...
@@ -90,10 +87,10 @@ done
echo
'[Ok]'
echo
'[Ok]'
echo
-n
'comparing dumps... '
echo
-n
'comparing dumps... '
if
[
!
-z
"
$(
diff
*
)
"
]
;
then
if
!
diff
-q
*
>
/dev/null
;
then
echo
$(
diff
*
)
diff
*
echo
"The second dump differs from the first one. This possibly means
that tests changed the real database."
failure
"The second dump differs from the first one. This possibly means
"
\
exit
1
"that tests changed the real database."
fi
fi
echo
'[Ok]'
echo
'[Ok]'
rm
-r
$backupdir
rm
-r
$backupdir
...
...
This diff is collapsed.
Click to expand it.
utils/backup.sh
+
7
−
7
View file @
4cc258e9
...
@@ -32,7 +32,7 @@ if [ -z "$UTILSPATH" ]; then
...
@@ -32,7 +32,7 @@ if [ -z "$UTILSPATH" ]; then
fi
fi
# The directory which the dump is to be stored to. Do not change it here. Use
# The directory which the dump is to be stored to. Do not change it here. Use
# the
the
environment variable instead.
# the environment variable instead.
BACKUPDIR
=
"
${
BACKUPDIR
:-
../backup
}
"
BACKUPDIR
=
"
${
BACKUPDIR
:-
../backup
}
"
# Load settings from .config and defaults #####################################
# Load settings from .config and defaults #####################################
...
@@ -48,16 +48,16 @@ function backup() {
...
@@ -48,16 +48,16 @@ function backup() {
# Assert backup dir
# Assert backup dir
mkdir
-p
"
$backupdir
"
mkdir
-p
"
$backupdir
"
dat
a
string
=
$(
date
-u
--rfc-3339
=
ns |
sed
's/ /T/g'
)
dat
e
string
=
$(
date
-u
--rfc-3339
=
ns |
sed
's/ /T/g'
)
backupfile
=
${
BACKUPDIR
}
/
${
DATABASE_NAME
}
.
${
dat
a
string
}
.dump.sql
backupfile
=
${
BACKUPDIR
}
/
${
DATABASE_NAME
}
.
${
dat
e
string
}
.dump.sql
if
[
-e
"
$backupfile
"
]
;
then
if
[
-e
"
$backupfile
"
]
;
then
failure
"
d
umpfile already exists."
failure
"
D
umpfile
'
$backupfile
'
already exists."
fi
fi
echo
"Dumping database
$database
to
$backupfile
...
"
echo
"Dumping database
$database
to
$backupfile
..."
$MYSQLDUMP_CMD
$(
get_mysql_args_nodb
)
--opt
--default-character-set
=
utf8
\
$MYSQLDUMP_CMD
$(
get_mysql_args_nodb
)
--opt
--default-character-set
=
utf8
\
--routines
"
$database
"
>
"
$backupfile
"
--routines
"
$database
"
>
"
$backupfile
"
success
success
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment