2013年10月2日 星期三

8.架設Tomcat 6 MySql VPS CentOs 6,Navicat 遠端登入 Mysql

From Evernote:

8.架設Tomcat 6 MySql VPS CentOs 6,Navicat 遠端登入 Mysql

8.Navicat 遠端登入 Mysql

因為Navicat 只認得ppk格式的private key所以要把 id_rsa檔轉成 id_rsa.ppk,這樣navicat才能透過ssh控制mysql (相關ssh設定請見 2. 設定SSH及金鑰設定)


8-1 id_rsa轉成id_rs.ppk

先開啟puttygen.exe 選Load 選id_rsa 後 Save private key 即可



8-2 id_rsa轉成id_rs.ppk



8-3 登入會出現 1045 錯誤


8-4 解決navicat登入會出現 1045 錯誤

進入主機後一定要停止mysql 否則所有指令無效

[root@jay ~]#  /etc/init.d/mysqld stop         #停止Mysql

Stopping mysqld:                                           [  OK  ]

[root@jay ~]# mysql -uroot mysql -p          #試試看是不是真有 停止,一定要停止才能改

Enter password:       #輸入密碼1234 如下面出弄ERROR 2002為錯誤 為真的有停止運作

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

[root@jay ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &         #以非運行mysql方式登入

[1] 866

[root@jay ~]# 130719 05:06:30 mysqld_safe Logging to '/var/log/mysqld.log'.

130719 05:06:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql


[root@jay ~]# mysql -uroot mysql -p     #非運行方式登入mysq

Enter password:             #按Enter即可 不用輸入密碼

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.5.31 MySQL Community Server (GPL)


Copyright (c) 2000, 2013, 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.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> UPDATE user SET Password=PASSWORD('1234') where USER='root';   #在更新root一次

Query OK, 3 rows affected (0.00 sec)

Rows matched: 4  Changed: 3  Warnings: 0


mysql> quit  #離開mysql

Bye

[root@jay ~]# reboot    #重開linux即可



沒有留言:

張貼留言