diff --git a/data/helpers.d/mysql b/data/helpers.d/mysql index 56741ec0e..8aa81a1fe 100644 --- a/data/helpers.d/mysql +++ b/data/helpers.d/mysql @@ -8,7 +8,7 @@ MYSQL_ROOT_PWD_FILE=/etc/yunohost/mysql # usage: ynh_mysql_connect_as user pwd [db] # | arg: user - the user name to connect as # | arg: pwd - the user password -# | arg: db - the database to connect to +# | arg: db - the database to connect to ynh_mysql_connect_as() { mysql -u "$1" --password="$2" -B "${3:-}" } @@ -17,7 +17,7 @@ ynh_mysql_connect_as() { # # usage: ynh_mysql_execute_as_root sql [db] # | arg: sql - the SQL command to execute -# | arg: db - the database to connect to +# | arg: db - the database to connect to ynh_mysql_execute_as_root() { ynh_mysql_connect_as "root" "$(sudo cat $MYSQL_ROOT_PWD_FILE)" \ "${2:-}" <<< "$1" @@ -27,7 +27,7 @@ ynh_mysql_execute_as_root() { # # usage: ynh_mysql_execute_file_as_root file [db] # | arg: file - the file containing SQL commands -# | arg: db - the database to connect to +# | arg: db - the database to connect to ynh_mysql_execute_file_as_root() { ynh_mysql_connect_as "root" "$(sudo cat $MYSQL_ROOT_PWD_FILE)" \ "${2:-}" < "$1"