<commit_before>Running MySQL
-------------

For Saucy Salamander:

create ~/.my.cnf (substitute XXXXX with your container uid)
```ini
[mysqld]
pid-file        = /containers/XXXXX/db.mysql/mysqld.pid
socket          = /containers/XXXXX/db.mysql/mysqld.sock
datadir         = /containers/XXXXX/db.mysql
character-set-server=utf8

[client]
socket          = /containers/XXXXX/db.mysql/mysqld.sock
```

run

```sh
mysql_install_db --defaults-file=.my.cnf
```

and (for allowing transparent compatibility with debian/ubuntu mysql environment)

```
ln -s $HOME/db.mysql /var/run/mysqld
```

create vassals/mysql.ini

```ini
[uwsgi]
smart-attach-daemon = $(HOME)/db.mysql/mysqld.pid mysqld --defaults-file=$(HOME)/.my.cnf
```

Check logs/emperor.log, if all goes well you can start using mysql normally (remember to assign a root password)

Backup
******

```pl
#!/usr/bin/env perl

use strict;
use warnings;
use DBI ;<commit_msg>Update mysql.md<commit_after>Running MySQL
-------------

For Saucy Salamander:

create ~/.my.cnf (substitute XXXXX with your container uid)
```ini
[mysqld]
pid-file        = /containers/XXXXX/db.mysql/mysqld.pid
socket          = /containers/XXXXX/db.mysql/mysqld.sock
datadir         = /containers/XXXXX/db.mysql
character-set-server=utf8

[client]
socket          = /containers/XXXXX/db.mysql/mysqld.sock
```

run

```sh
mysql_install_db --defaults-file=.my.cnf
```

and (for allowing transparent compatibility with debian/ubuntu mysql environment)

```
ln -s $HOME/db.mysql /var/run/mysqld
```

create vassals/mysql.ini

```ini
[uwsgi]
smart-attach-daemon = $(HOME)/db.mysql/mysqld.pid mysqld --defaults-file=$(HOME)/.my.cnf
```

Check logs/emperor.log, if all goes well you can start using mysql normally (remember to assign a root password)

Backup
------

```pl
#!/usr/bin/env perl

use strict;
use warnings;
use DBI ;
{'fraction_non_alphanumeric': 0.1553030303030303, 'fraction_numerical': 0.0010822510822510823, 'mean_word_length': 3.3505882352941176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3466825', 'n_tokens_mistral': 684, 'n_tokens_neox': 649, 'n_words': 157}