Linux

MySQL / MariaDB

41 flashcards · answers and spaced-repetition review in the KnowCard app

You wrote a proprietary closed-source product that bundles the MySQL server. Someone tells you MySQL is free software, so no license is needed. Where does that reasoning break down?
A colleague assumes every distro ships MySQL. On Debian, Fedora, and openSUSE you can't find a MySQL package at all — only MariaDB. What is going on?
You picked a MariaDB version for a system you'll run for several years. Why does grabbing whatever is newest sometimes leave you patched for only one year?
You're migrating a server and need to copy the actual database contents, whether it runs MySQL or MariaDB. Which directory holds the data files?
The database won't come up after a config edit and you want to see why. What's a distribution-independent way to read the startup errors?
You edited settings under the [mysqld] section but nothing changed. Why, and how do other sections of the config behave differently?
For hardening you want to lock the DB to the local machine. What's the practical difference between bind-address = 127.0.0.1 and skip-networking, and why can the stricter one break clients?
A new admin assumes the MySQL root account and the Linux root account are the same login. In what two ways can a DB user actually authenticate, and why does that assumption fail?
On a fresh Debian box you type mysql as root and get in with no password — yet the docs call this secure. Why is that safe here but a disaster on default MySQL 8 on RHEL?
After installing MySQL 8 on RHEL, what does mysql_secure_installation actually change, and why bother if the server already runs?
You're auditing whether any DB account can log in without a password. What exactly do you inspect on a modern MySQL server versus on MariaDB?
You need to give an application its own restricted database account. What two SQL commands set it up, and what password mistake must you avoid?
Someone says they'll stop the database by killing the mysql process. Why is that the wrong target, and what is the mysql program actually for?
You want to script routine DB admin like creating databases. mysqladmin can do it as shell commands — what one habit exposes your password, and how do you avoid it?
Your DB has skip-networking set and rejects all network connections, yet phpMyAdmin still administers it fine. How, and why is phpMyAdmin itself a liability?
Beyond a hard MySQL password, what layered precautions should you take specifically because phpMyAdmin gets scanned and attacked so often?
You run mysqldump for a backup while the app keeps writing. Which option guarantees a consistent snapshot, and which one makes the restore not fail on existing tables?
mysqldump output is huge because it's plain text. How do you compress on the fly, and when would you pick lzop over gzip?
Your database must run 24/7 and mysqldump is starting to hurt live performance. What hot-backup options exist, and which one won't work on MariaDB?
You enable binary logging for point-in-time recovery, then someone argues it replaces regular backups. Why is that dangerously wrong?
You're deploying a web app such as WordPress into the web root. Beyond copying files, what four setup steps make it actually run — and what extra step does RHEL demand?
Disaster hits your WordPress site. You have a full mysqldump of the database — is that enough to restore, and if not, what else must you have kept?
You built a CMS on MariaDB and now want to move its raw data files straight onto an original MySQL server. Why might that no longer just work?
Your distribution only ships a very old MariaDB package. What's the recommended way to install a current version, and how is the software split into packages?
You installed MariaDB on Fedora but nothing is listening on the database port. On Debian it worked right after install. What step does Fedora/RHEL/openSUSE need?
You want to edit MySQL's server settings but there's no /etc/my.cnf on this box. Where else can the configuration file live?
New tables on your older MariaDB install mangle non-English text. What default is biting you, and how do you make new databases use UTF-8?
Your app reaches MariaDB fine over IPv4 but every IPv6 attempt is refused. What's the default, and what two settings change it?
On Debian you log into MariaDB as root with no password; a colleague says the same trick uses a differently-named plugin on MySQL. Which plugins implement this Linux-account mapping?
Auditing a MariaDB server, you dump mysql.global_priv and see a Priv column full of JSON. How do you spot an account that can log in unprotected?
On Debian, DB root only works via socket login as Linux root. How do you add a password-protected admin usable from any account, and what naming slip wipes your default root?
To keep things simple, is it fine to give the MySQL root account the same password as the Linux root account?
You need the mysql client to reach a database on another host as a specific user. Which options do that, and when does -p stop working?
Your team wants a graphical tool to manage a MariaDB server. Does MySQL Workbench fit, and what is one thing it won't let you edit?
You install phpMyAdmin by hand and it can't reach the database; on Ubuntu the setup also skipped your NGINX web server. What two things must you fix?
A large mysqldump is slow to take and slow to reload. Which options shrink the file and speed up the restore?
Your mysqldump on MySQL 8 fails with an access-denied error. What quick option gets around it, and what's the alternative?
You inspect authentication on MariaDB by reading mysql.user just as you would on MySQL. Why can that mislead you?
You have a single-database mysqldump file to import. What must you do before piping it in, and which option preserves UTF-8 strings?
mysqldump increasingly slows your always-on database. How does mylvmbackup cut the blocking, and what two constraints come with its backups?
Once binary logging is on, replicating to a standby server is easy. Why is that live replica still not a substitute for backups?

Start learning today

Free to start — download the app or use it in your browser.

Get it on App StoreGet it on Google Play
MySQL / MariaDB (Linux) · KnowCard