Mysql
From SUNY Potsdam ACM
Template for Posting
Go to the bottom of the postings, and paste this snippet and edit to your liking.
== My Posting == Description <syntaxhighlight lang="sql"> //Your code here </syntaxhighlight>
Adding A User
To avoid flipping through pages of documentation, this is a shortcut to adding a user to a MySQL db. First, you must create a database. What this does is creates a use that has COMPLETE permissions on a specific Database.
--Anthony Clark
GRANT ALL PRIVILEGES ON my_database.* TO 'my_user'@'localhost' IDENTIFIED BY 'my_password' WITH GRANT OPTION;
Backup/Restore a Database
At a shell...
USER is usually 'root'
# Backup mysqldump -u USER -p DATABASENAME > dumpfilename.sql # Restore mysql -u USER -p DATABASENAME < dumpfilename.sql