Book Image

Raspberry Pi Media Center

By : Sam Nazarko
Book Image

Raspberry Pi Media Center

By: Sam Nazarko

Overview of this book

<p>Low-cost and high-performing, with a massively diverse range of uses and applications, the Raspberry Pi is set to revolutionize the way we think about computing and programming. Using it as a Media Center allows everyone to have a low-cost device that is always on, attached to their TV. <br /><br />Imagine controlling your TV with your smartphone, dynamically streaming content that you have on various devices across your home, as and when you want. Raspberry Pi Media Center will show you how to configure the complete experience using readily available and accessible tools, so that you too will soon be enjoying your media from the comfort of your own sofa. <br /><br />With this practical guide, you’ll discover how you can transform your Raspberry Pi into a powerful media center. Using Raspbmc (based on the XBMC distribution), you'll be shown how you can deploy and configure your own media center, including coverage of all the essentials from controlling your device with a TV remote or smartphone, to the creation and customization of your very own media library (including the conversion of any existing collection). You'll even be able to stream multimedia from your devices or directly from the Internet!</p>
Table of Contents (17 chapters)

Appendix B. Useful MySQL Commands

This appendix will give you a short summary of useful MySQL commands that can be executed at the command line on the system that is hosting the MySQL database.

Some useful commands are given in the following table. It should be noted that this is not a comprehensive list of commands.

Description of the command

Command to be run on Raspbmc

Connects to MySQL with the user as root and the password as password

mysql -u root -ppassword

Remember, there must be a space after -u to specify the user, but the password must be attached to -p

Creates a user with a specific password

CREATE USER ‘sam’@’localhost’ IDENTIFIED BY ‘password’;

Creates a database

CREATE DATABASE somedb;

Grants a user full privileges to access all databases

GRANT ALL PRIVILEGES ON *.* TO ‘sam’@’%’;

Grants a user full privileges to access a specific database

GRANT ALL PRIVILEGES ON somedb.* TO ‘sam@localhost’;

Deletes a MySQL database

DROP DATABASE dbname;

Makes a backup of a database

mysqldump  -u root -ppassword somedb > backup.sql

Restores a backup of a database

mysql –u root -ppassword somedb < backup.sql

Note that somedb, sam, and dbname, used in preceding table, are just examples and should be substituted accordingly to match your configuration.

More information about MySQL commands can be obtained from http://dev.mysql.com/doc/refman/5.0/en/mysql-commands.html.