OpenStack in a snap!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

50 lines
2.3 KiB

#!/bin/bash
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cat << EOF
= MySQL Snap Image =
The MySQL snap image is an experimental release of MySQL for the snap universal Linux package system (http://snapcraft.io/).
This image should be used for testing only, and is not suitable for a production environment.
== Commands ==
- mysql.client: Runs the MySQL client
- mysql.server: Runs the MySQL server
- mysql.startup: Initializes database if necessary, then starts the server
- mysql.help: Shows this document
== Usage guide ==
The MySQL snap requires access to the process-control interface. You connect it by running:
snap connect mysql:process-control core:process-control
=== Running the snap ===
* Install the snap as usual
* Run sudo snap connect mysql:process-control ubuntu-core:process-control
* Run mysql.startup to initialize and start the server
* Run mysql.client -uroot -p
=== Running the snap a system service ===
Running MySQL as a system service requires root access, but the server itself should never run as root, so it drops privileges to a dedicated user. This user must own the server files and directories. Currently snapd blocks access to creating users and changing process user, so the only way to do this is to disable the restrictions by installing the snap with the --devmode argument.
=== Files and directories ===
The first time you run mysql.startup, it will generate the following in $HOME/snap/mysql/common (if run as root, /var/snap/mysql/common is used instead):
- conf/my.cnf: Basic configuration file
- data/: Data directoriy
- files/: Default location for the secure-file-priv option
- log/: Location of error log
- run/: Location of sock and pid files
EOF