ユーザ用ツール

サイト用ツール


mysql

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
mysql [2014/02/22 13:26] nabezomysql [2021/06/06 22:37] (現在) nabezo
行 1: 行 1:
 ====== ubuntuにinstall ====== ====== ubuntuにinstall ======
-  apt-get install mysql-server+  apt-get install mysql-server mysql-client
  
 ちなみにuninstall ちなみにuninstall
   apt-get purge mysql-server mysql-common   apt-get purge mysql-server mysql-common
  
-=====backup====+====== 設定 ====== 
 +セキュリティ設定ツール(rootパスワード等) 
 +  sudo mysql_secure_installation 
 + 
 +  sudo mysql -u root 
 + 
 +設定ファイル(/etc/mysql/mysql.conf.d/mysqld.conf) 
 +  character-set-  = utf8 
 +   
 +  bind-address =  
 + 
 + 
 +======backup======
   $ mysqldump -u root データベース名 > dump.sql   $ mysqldump -u root データベース名 > dump.sql
  
行 13: 行 25:
   * --no-data (-d)   * --no-data (-d)
  
-=====restore====+======restore======
   $ mysql -u root データベース名 < dump.sql    $ mysql -u root データベース名 < dump.sql 
  
 +======create database======
 +db作成
 +  create database xxxxdb;
 +ユーザ作成
 +  create user 'xxxxid'@'localhost' identified by 'xxxxpass';
 +ユーザにDB権限追加
 +  GRANT ALL on xxxxdb.* to 'xxxxid'@'localhost' identified by 'xxxxpass';
 +
 +
 +====== sshで接続 ======
 +  #!/bin/bash
 +  ssh -f -N -L 3307:localhost:3306 -i .ssh/rsa.pem user@host
 +  sleep 3
 +  mysql --user=uid --password=pwd --host=127.0.0.1 --port=3307
  
  
  
  
mysql.1393043177.txt.gz · 最終更新: 2019/06/30 12:22 (外部編集)