LoginSignup
2
1

More than 5 years have passed since last update.

MariaDB on CentOS 7

Posted at

セットアップ

yum install mariadb mariadb-server
必要かわからないが,/var/lib/mysql/にmysql.sockなるソケットが無いので,空のファイルを作成.

touch /var/lib/mysql/mysql.sock
systemctl start mariadb
mysql_secure_installation

mysqldumpでとっているバックアップがあれば,以下のコマンドで反映させる.
mysql -u root -p < alldata.sql

バックアップの取り方&復元

まず,バックアップの方法.
mysqldump --all-databases --user=root --password --master-data > alldata.sql'''
次に,取り込み方.
mysql -u root -p < alldata.sql```

よく使うコマンド集

以下,mysqlの中
```
show databases; # データベース閲覧

select user from mysql.user; # ユーザ一覧
use “database”; # "データベース名"に入る
show tables; # テーブル一覧
show variables like ‘hostname’; # hostnameを表示
```

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1