Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 604 Bytes

mysql.md

File metadata and controls

29 lines (19 loc) · 604 Bytes

MySQL

Accessing from shell

mysql --user=root --password
mysql --user=root --password -p someDB

Basic

use someDB;
create database someDB;
drop database someDB;
describe someTable;
show columns from someTable;

Create user

grant all privileges on mydb.* to mydbuser@localhost identified by 'mydbpassword';
grant all privileges on mydb.* to mydbuser@% identified by 'mydbpassword';

Backup and Restore

mysqldump someDB   --user=root --password > backup.sql
mysql -u root -p someDB < backup.sql

Change password

mysqladmin -u root -p password