Update mariadb.md
This commit is contained in:
@@ -6,3 +6,15 @@
|
||||
CREATE DATABASE dbn CHARACTER SET utf8 COLLATE utf8_general_ci;
|
||||
CREATE USER 'usr'@'localhost' IDENTIFIED BY 'pwd'; GRANT ALL PRIVILEGES ON dbn.* TO usr@localhost;
|
||||
```
|
||||
|
||||
## Create dump by table
|
||||
```bash
|
||||
for tab in `echo "SHOW TABLES" | mysql dbName | grep -v Tables_in_`; do
|
||||
mysqldump --extended-insert=FALSE dbName "$tab" > "dbName-$tab-`date +%Y-%m-%d`.sql"
|
||||
done
|
||||
```
|
||||
|
||||
## Append field in table
|
||||
```sql
|
||||
ALTER TABLE existsTableName ADD COLUMN `newFieldName` varchar(64) NOT NULL DEFAULT '';
|
||||
```
|
||||
|
Reference in New Issue
Block a user