0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[mysql] 外部DBサーバへログインするには

Posted at

apacheとmysqldが同じサーバに入っているなら、下記のようにログインする。

shell
mysql -u ユーザ名 -p データベース名

がしかし、DBが外部サーバにあり、それと連携させるとなると、ええええええどうすりゃいいのさ!!!と自分はなったので、そのまとめ。

結論

shell
mysql -u ユーザ名 -h DBサーバアドレス -p

-h オプションでサーバを指定すればいいらしい。

ただ上記コマンドの通り、
DBサーバにあるDBの編集権を持っているユーザの情報が必要なので、そこは注意。

以上

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?