Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Monday, January 19, 2015

Update MySQL User Password

SET PASSWORD FOR 'root'@'localhost' = '';

The SQL script above sets the password for the user root to blank.
The script will run successfully if the current user has UPDATE privilege on the MySQL database.

Saturday, October 8, 2011

Using and Creating a MySQL Dump

To use a database dump:
mysql -u <username> -p  <database_schema> < schema_dump.sql

To create a dump for the whole database:
mysqldump -u <username> -p  <database_schema> > schema_dump.sql

To create a dump of only a specific table of the database:
mysqldump -u <username> -p <database_schema> <table_name> > table_dump.sql

To create a compressed dump all of the databases on your MySQL:
mysqldump --all-databases -p | bzip2 -c > databasebackup.sql.bz2

Just make sure to enter the correct values on the parts enclosed between < and >.