A collection of classes and commands for automated command line scripting using Python.
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.

78 lines
1.5 KiB

3 years ago
# MySQL
Summary: Work with MySQL (and Maria) databases.
## Common Options
- `admin_pass`: The password off the admin-authorized user.
- `admin_user`: The user name of the admin-authorized user. Default: `root`
- `host`: The host name. Default: `localhost`
- `port`: The TCP port. Default: `3306`
## Available Commands
### mysql.create
Create a database. Argument is the database name.
- `owner`: The user name that owns the database.
```ini
[create the database]
mysql.create: database_name
```
### mysql.drop
Drop a database. Argument is the database name.
### mysql.dump
Dump the database schema. Argument is the database name.
- `path`: The path to the dump file. Default: `dump.sql`
### mysql.exec
Execute an SQL statement. Argument is the SQL statement.
- `database`: The name of the database where the statement will be executed. Default: `default`
### mysql.exists
Determine if a database exists. Argument is the database name.
### mysql.grant
Grant privileges to a user. Argument is the privileges to be granted.
- `database`: The database name where privileges are granted.
- `user`: The user name for which the privileges are provided.
1 year ago
### mysql.user
3 years ago
1 year ago
Create a user. Argument is the username.
3 years ago
- `password`: The user's password.
1 year ago
```ini
[create a database user]
mysql.user: username
```
3 years ago
1 year ago
Remove a user.
3 years ago
1 year ago
```ini
[create a database user]
mysql.user: username
op: remove
```
3 years ago
1 year ago
Determine if a user exists.
```ini
[create a database user]
mysql.user: username
op: exists
```