MySql Notes

To access a database:

mysql -h localhost -u ttrss -p ttrssdb

To list the tables in said database:

mysql> show tables;

To create a database as root, and a user to go with it:

mysql -u root -p
mysql> CREATE DATABASE ttrssdb;
mysql> GRANT ALL ON ttrssdb.* TO ttrss IDENTIFIED BY "ttrss";


mysql -u root -p
mysql> CREATE DATABASE piwikdb;
mysql> GRANT ALL ON piwikdb.* TO 'piwik'@'localhost' IDENTIFIED BY 'piwik';

To dump a database as root:

mysqldump -u root -p ttrssdb > ttrss.sql

And to import it back:

mysql -u root -p ttrssdb < ttrss.sql

MySqlNotes (last edited 2014-10-30 23:26:48 by DesmondRivet)