mysql

Administer MySQL and MariaDB databases.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "mysql" with this command: npx skills add bagelhole/devops-security-agent-skills/bagelhole-devops-security-agent-skills-mysql

MySQL / MariaDB

Administer MySQL and MariaDB databases.

Installation & Setup

Install

apt install mysql-server

Secure installation

mysql_secure_installation

Access

mysql -u root -p

Create database and user

CREATE DATABASE mydb; CREATE USER 'myapp'@'%' IDENTIFIED BY 'secret'; GRANT ALL PRIVILEGES ON mydb.* TO 'myapp'@'%'; FLUSH PRIVILEGES;

Configuration

/etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld] innodb_buffer_pool_size = 1G max_connections = 200 slow_query_log = 1 long_query_time = 2

Backup & Restore

Backup

mysqldump -u root -p mydb > backup.sql mysqldump -u root -p --all-databases > full_backup.sql

Restore

mysql -u root -p mydb < backup.sql

Replication

Primary

[mysqld] server-id = 1 log_bin = mysql-bin

Replica

CHANGE MASTER TO MASTER_HOST='primary', MASTER_USER='replicator', MASTER_PASSWORD='secret', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=0; START SLAVE;

Best Practices

  • Enable slow query logging

  • Use InnoDB storage engine

  • Regular backups with mysqldump

  • Monitor with SHOW PROCESSLIST

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

sops-encryption

No summary provided by upstream source.

Repository SourceNeeds Review
Security

linux-administration

No summary provided by upstream source.

Repository SourceNeeds Review
Security

linux-hardening

No summary provided by upstream source.

Repository SourceNeeds Review