# コメントアウト # bind-address = 127.0.0.1 OR bind-address = 0.0.0.0
bind-address = 127.0.0.1
bind-address = 192.168.0.XXX
この場合、mysql -h 127.0.0.1 で接続できない
bind-address = 192.168.168.XXX
この場合、mysqlが起動しない
bind-address = 192.168.0.XXX bind-address = 192.168.0.YYY
最後が有効
bind-address = 192.168.0.XXX 192.168.0.YYY
最初が有効
mysql> select user,host from mysql.user; +------+-----------------------+ | user | host | +------+-----------------------+ | root | 127.0.0.1 | | root | ::1 | | | localhost | | root | localhost | | | localhost.localdomain | | root | localhost.localdomain | +------+-----------------------+
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | synctest | | test | +--------------------+
mysql> grant all privileges on *.* to user1@"%" identified by 'パスワード' with grant option;
mysql> grant all privileges on dbname.* to user1@"192.168.0.%" identified by 'パスワード' with grant option;
mysql> grant all privileges on dbname.* to user1@"localhost" identified by 'パスワード' with grant option;
mysql> drop user 'user'@'localhost';