Tuesday, May 22, 2012

MySQL

Create a database:

mysql -u root -p 
-- at prompt enter mysqlRootPassword

CREATE DATABASE yourNewDbName CHARACTER SET utf8;
CREATE USER 'yourNewUserName'@'localhost' IDENTIFIED BY 'yourNewPassword';
GRANT ALL PRIVILEGES ON yourNewDbName .* TO 'yourNewUserName'@'localhost';

Backup a database:

mysqldump -u yourUserName -p yourDbName > /tmp/newFile.sql
yourPassword
{ "loggedin": false, "owner": false, "avatar": "", "render": "nothing", "trackingID": "UA-36983794-1", "description": "MySQL syntax, examples, tutorial.", "page": { "blogIds": [ 68 ] }, "domain": "holtstrom.com", "base": "\/michael", "url": "https:\/\/holtstrom.com\/michael\/", "frameworkFiles": "https:\/\/holtstrom.com\/michael\/_framework\/_files.4\/", "commonFiles": "https:\/\/holtstrom.com\/michael\/_common\/_files.3\/", "mediaFiles": "https:\/\/holtstrom.com\/michael\/media\/_files.3\/", "tmdbUrl": "http:\/\/www.themoviedb.org\/", "tmdbPoster": "http:\/\/image.tmdb.org\/t\/p\/w342" }