mysql commands for working with the Cloudera VMs
Login
mysql -uroot
-pcloudera
Dump a database to a file
mysqldump -u root -p
mydatabase > /home/myuser/database-dump.sql
Restore mySQL dump file to a mySQL database
mysql -u username -p database_name < file.sql
mysqldump -u training -p trainingdatabase > /home/training/trainingdatabase-dump.sql
mysql -u root -p loudacre < loudacredatabase-dump.sql
mySQL commands
SHOW DATABASES;
CREATE DATABASE loudacre;
use loudacre;
show tables;
mysql -u root -p
loudacre -e "describe webpage"
mysql -u root -p loudacre -e "select * from webpage limit 5"
mysql -u root -p loudacre -e "select * from webpage limit 5"
Comments
Post a Comment