MySQL

Basic Setup

Before running the mysql server for the first time, run

mysql_install_db

As root. Then log in with

mysql -u root -p

And create a user with the CREATE USER command.

To only run it locally, use a local socket file specified in my.cnf. (E.g. /var/run/mysql/mysql.sock) Then put activate the option

skip-networking

Dumping / Importing a database

To dump a database:

mysqldump --add-drop-database --databases db_name > dump.sql

And to load the dump, on a mysql shell:

source dump.sql