Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@cilly

MySQL(5.7)メモ

More than 3 years have passed since last update.

MACにbrewでMySQLを入れてみた

$ brew update
$ brew install mysql
$ brew info mysql

mysql: stable 5.7.17 (bottled)

validate_password

mysqlを入れるとvalidate_passwordgaが入っている。

確認

mysql> SHOW GLOBAL VARIABLES LIKE 'validate%';

変更

mysql> SET GLOBAL validate_password_length=4;
mysql> SET GLOBAL validate_password_policy=LOW;

confで設定

mysql.server startの度にリセットされるみたいなので、 /etc/my.confを修正する。

/etc/my.conf
[mysqld]
validate_password_length=4
validate_password_policy=LOW

rootのパスワードをなしにする

mysql> update user set authentication_string='' where User='root';

アンインストールvalidate_password

mysql> UNINSTALL PLUGIN validate_password;

インストールvalidate_password

mysql> INSTALL PLUGIN validate_password SONAME 'validate_password.so';

GRANT ON で権限操作の際にERROR 1819

これまでだったらこれでも良かった記憶

mysql> GRANT select,update,insert,delete ON db_name.table_name TO 'user'@'%';

しかし Your password does not satisfy the current policy requirements

mysql> GRANT select,update,insert,delete ON db_name.table_name TO 'user'@'%' IDENTIFIED BY 'password';

IDENTIFIEDで対象のuserのパスワードを指定する必要があるみたい。

LaravelのBD設定

configのdatabase.phpでunix_socket情報の追加が必要になってた

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory

こんなエラーがでてしまう

mysqladmin version
Server version      5.7.17
Protocol version    10
Connection      Localhost via UNIX socket
UNIX socket     *** <- これ
Uptime:         2 days 2 hours 40 min 57 sec
0
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
cilly

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?