Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Tietokantojen perusteet ja tietokantaohjelmointi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Akseli Harju
Tietokantojen perusteet ja tietokantaohjelmointi
Commits
e9869d58
Commit
e9869d58
authored
1 year ago
by
eerohuusko
Browse files
Options
Downloads
Patches
Plain Diff
Lisätty shell scripti
parent
6a065ddd
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
01_jupyterhub_ympariston_kayttoonotto/save_my_corrupted_database.sh
+30
-0
30 additions, 0 deletions
...hub_ympariston_kayttoonotto/save_my_corrupted_database.sh
with
30 additions
and
0 deletions
01_jupyterhub_ympariston_kayttoonotto/save_my_corrupted_database.sh
0 → 100644
+
30
−
0
View file @
e9869d58
!
/bin/bash
echo
"Check if mysqld process is running (we need to dump database)"
if
pgrep
-x
mysqld
>
/dev/null 2>&1
then
echo
"Dumping all databases to all_databases_dump.sql. Password is empty if you haven't changed it"
mysqldump
-u
root
-p
--socket
=
/tmp/mariadb_kernel/mysqld.sock
--all-databases
>
all_databases_dump.sql
else
echo
"Please start MariaDB-Kernel and run the script again"
exit
fi
echo
"Dumping all databases to all_databases_dump.sql
mysqldump -u root -p --socket=/tmp/mariadb_kernel/mysqld.sock –all-databases > all_databases_dump.sql
echo "
Please go to menu: Kernel -> Shutdown All Kernels...
echo
"Press enter after you have shutdown all kernels"
read
-s
#check if python3 process is running (kernels are started with python3)
if
pgrep python3
>
/dev/null 2>&1
then
echo
"Seems you forgot to Shutdown All Kernels..."
echo
"Please got to menu: Kernel -> Shutdown All Kernels and run the script again"
else
rm
-rf
/home/jovyan/work/.db/
echo
"Please start MariaDB-kernel by Starting new MariaDB Notebook. Wait kernel to go Idle-status before giving password (should be empty)
\n
"
mysql
-u
root
-p
--socket
=
/tmp/mariadb_kernel/mysqld.sock < all_databases_dump.sql
fi
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