The last notes
All English-language materials have been translated fully automatically using the Google service
Connecting to the database
mysql -u root -p
Create a database
create database DB_NAME;
Getting the list of databases
SHOW DATABASES;
Create a database user with a password
create user 'DB_USER' @ 'localhost' identified by 'DB_USER_PASS';
Setting user privileges
GRANT ALL PRIVILEGES ON DB_NAME. * to 'DB_USER' @ 'localhost'
-> IDENTIFIED BY 'pass' WITH GRANT OPTION;
Renewing privileges
FLUSH PRIVILEGES;
Delete user
DROP USER 'DB_NAME' @ 'localhost';
Removing the database
mysql> drop database DB_NAME;
Export to file
mysqldump -uLogin -pPassword db_name> db_name.sql
Import from file
mysql -u username -p database_name
Comments