Running query as root user
This commit is contained in:
parent
e1b8af8664
commit
346e85f4b9
|
@ -171,7 +171,7 @@ function install_mariadb {
|
|||
# See http://www.pontikis.net/blog/debian-9-stretch-rc3-web-server-setup-php7-mariadb
|
||||
# https://mariadb.com/kb/en/mariadb/unix_socket-authentication-plugin
|
||||
function_check run_query
|
||||
run_query mysql "update mysql.user set plugin = '' where User='root'; flush privileges;"
|
||||
run_query_root mysql "update mysql.user set plugin = '' where User='root'; flush privileges;"
|
||||
|
||||
mysqladmin -u root password "$MARIADB_PASSWORD"
|
||||
mark_completed $FUNCNAME
|
||||
|
@ -285,6 +285,12 @@ function run_query {
|
|||
mysql -u root --password="$MARIADB_PASSWORD" -e "$database_query" $database_name
|
||||
}
|
||||
|
||||
function run_query_root {
|
||||
database_name=$1
|
||||
database_query=$2
|
||||
mysql -e "$database_query" $database_name
|
||||
}
|
||||
|
||||
function run_query_with_output {
|
||||
database_name=$1
|
||||
database_query=$2
|
||||
|
|
Loading…
Reference in New Issue