Skip to content

Instantly share code, notes, and snippets.

@Ryomasao
Last active June 8, 2020 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ryomasao/26b51efb47fcd301eb4f562cc1baf837 to your computer and use it in GitHub Desktop.
Save Ryomasao/26b51efb47fcd301eb4f562cc1baf837 to your computer and use it in GitHub Desktop.
mysql

mysql

vagrantでつなぐ

外部ホストからの接続を許可する。 どのIPからもrootに対してアクセス可能にする。 パスワードの設定はしてないので、入力はしないこと。

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;

ユーザー一覧

mysql>  select Host, User, Password from mysql.user;
+------+-----------+-------------------------------------------+
| User | Host      | Password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| test | %         | *2B200E5AC212030A52EC9A252168B63541F7D67E |
| root | %         | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B 
+------+-----------+-------------------------------------------+

dump

https://qiita.com/PlanetMeron/items/3a41e14607a65bc9b60c

export

mysqldump -u user -p -h hostname database > dumpfile

import

mysql -u user -p -h hostname database < dumpfile

error

1049でこけたら

https://www.softel.co.jp/blogs/tech/archives/5041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment