2017年1月18日水曜日

mysql 5.6でgrantをしたら、ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tm p/mysql_q4m.sock' のエラー

解決方法は、以下のコマンドを実行
# mysql_upgrade -u root -p

Looking for 'mysql' as: /usr/local/q4m/bin/mysql
Looking for 'mysqlcheck' as: /usr/local/q4m/bin/mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.servers                                      OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Running 'mysql_fix_privilege_tables'...
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
freegame_queue.application_message_merge           OK
freegame_queue.game_playing_date                   OK
freegame_queue.guide_send_twitter_dm               OK
freegame_queue.mailbatch_mail                      OK
freegame_queue.messageapi_application_mail         OK
freegame_queue.messageapi_user_mail                OK
OK
Could not create the upgrade info file '/usr/local/q4m/var/mysql_upgrade_info' in the MySQL Servers datadir, errno: 13
[vagrant@010node mysql5.6q4m]$ sudo /usr/local/q4m/bin/mysql_upgrade -u root -p
Enter password:
Looking for 'mysql' as: /usr/local/q4m/bin/mysql
Looking for 'mysqlcheck' as: /usr/local/q4m/bin/mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Running 'mysql_fix_privilege_tables'...
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql_q4m.sock'
Warning: Using a password on the command line interface can be insecure.
freegame_queue.application_message_merge           OK
freegame_queue.game_playing_date                   OK
freegame_queue.guide_send_twitter_dm               OK
freegame_queue.mailbatch_mail                      OK
freegame_queue.messageapi_application_mail         OK
freegame_queue.messageapi_user_mail                OK
OK
[vagrant@010node mysql5.6q4m]$ /usr/local/q4m/bin/mysql -h localhost -P 13306 -u"root" -p"vagrant"
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.6.32-q4m-log Q4M

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

2017年1月15日日曜日

windows10のリモートデスクトップでタスクマネージャーを起動する方法

方法1、コマンドプロンプトを起動する。
     以下のコマンドを実行
     >taskmgr

方法2、ショートカットキー「Ctrl+Alt+End」を押す
     ちなみに、ローカル場合は、「Ctrl+Alt+Del」を押す

2017年1月9日月曜日

Stderr: VBoxManage.exe: error: Could not find a controller named 'SATA Controller' の解消方法

以下のような設定で vagrant up をしたら、タイトルのエラーが出来ました。
 ["storageattach", "5cbed0f4-9370-4603-8da8-f02b7f943cad", "--storagectl", "SATA Controller", "--port", "1", "--device", "0", "--type", "hdd", "--medium", "010node.com.vdi"]



解決手順は以下の通りです。
 1、まず VirtualBoxの設定画面で、「新しいストレージコントローラーを追加委します。」からSATAコントローラーを追加する

 
2、次に、 設定ファイルの「 "--storagectl", "SATA Controller"」を「 "--storagectl", "SATA"」に変更する。
 SATA Controllerの「名前」のところに、名前は「SATA」となっているので、それに合わせる必要。

2017年1月7日土曜日

cygwinでansibleインストール時に「 /usr/include/sys/time.h:104:34: エラー: 不明な型名 'u_int' です」のエラー解決方法

cyginでansibleをインストールしたら、以下のエラーが出来ました
 /usr/include/sys/time.h:104:34: エラー: 不明な型名 'u_int' です

解決方法は、ファイル「/usr/include/sys/time.h」に「u_int」の定義を追加すること

vi /usr/include/sys/time.h


#ifndef u_int
typedef unsigned int u_int;
#endif

cygwinにsshpassを入れる手順

Step1、まずダウンロード用ディレクトリーを作成
   mkdir -p /usr/local/src

Step2、Step1で作成したディレクトリーに移動
   cd /usr/local/src

Step3、sshpassのソースファイルをダウンロードする
   wget "https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz/download" -O sshpass.tar.gz

Step4、ダウンロードしたファイルを解凍
    tar xvfz sshpass.tar.gz

Step5、手動でコンパイルとインストールする
   cd sshpass-1.06
  
  ./configure
  make
  make install

    
Step6、バージョン確認
 sshpass -V


リモート windowsを再起動させる方法

リモート接続の場合は、「Start Menu」が操作できない状態となっています。

リモートマシンを再起動されるには、便利なコマンドがあります。
以下のコマンドを実行すれば、すぐ再起動できます。

shutdown -t 0 -r -f

-t 0:0秒後にシャットダウン
-r: 再起動
-f: アプリを強制的に停止

2017年1月6日金曜日

cygwinにのapt-cygにレポジトリーを追加する

以下のコマンドでmirror/repositoryを変更できます。

apt-cyg update -m ftp://ftp.cygwinports.org/pub/cygwinports