MySQL5.1/設定
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
**設定 [#k755298b]
#contents
----
***パスワード設定 [#la60c199]
mysql mysql
mysql> select user,host,password from user;
+------+-----------+----------+
| user | host | password |
+------+-----------+----------+
| root | locahost | |
| root | hostname | |
| root | 127.0.0.1 | |
| | locahost | |
| | hostname | |
+------+-----------+----------+
と、初期状態ではパスワード無し、ユーザー無しなので
空欄ユーザーは削除、rootにはパスワードを設定する。
DELETE FROM user where user='';
DELETE FROM user where user='root' and host='hostname';
GRANT ALL on *.* to root@"%" identified by 'hogehoge' wi...
SET PASSWORD FOR root@127.0.0.1 = PASSWORD('hogehoge');
FLUSH PRIVILEGES;
など。
***my.cnf [#zd0eb4b5]
未精査につき注意。
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
[mysqld]
## IPアドレスバインドやポート指定など
port = 3306
bind-address = xxx.xxx.xxx.xxx
#
## 何はともあれ設定
socket = /tmp/mysql.sock
#
## デフォルト文字コード設定
character-set-server = utf8
#
## 内蔵InnoDBは使わず、プラグインのInnoDBを使用する
ignore-builtin-innodb
plugin-load=innodb=ha_innodb_plugin.so
#
skip-external-locking
#skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
#
## ローカルでsocket通信しか行わないならアンコメント
#skip-networking
#
## SSLを有効にする(SSL Readyにするだけ)
ssl
#
## 実際には以下のパラメータが必要
#ssl_ca =
#ssl_capath =
#ssl_cert =
#ssl_cipher =
#ssl_key =
#
# Replication Master Server (default)
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
#master-host =
#master-user =
#master-password =
#master-port =
#master-connect-retry =
#master-ssl =
#master-ssl-ca =
#master-ssl-capath =
#master-ssl-cert =
#master-ssl-cipher =
#master-ssl-key =
[mysqldump]
skip-opt
create-options
default-character-set=binary
hex-blob
max_allowed_packet = 16M
master-data
quick
set-charset
single-transaction
[mysql]
no-auto-rehash
# Remove the next comment character if you are not famil...
#safe-updates
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
終了行:
**設定 [#k755298b]
#contents
----
***パスワード設定 [#la60c199]
mysql mysql
mysql> select user,host,password from user;
+------+-----------+----------+
| user | host | password |
+------+-----------+----------+
| root | locahost | |
| root | hostname | |
| root | 127.0.0.1 | |
| | locahost | |
| | hostname | |
+------+-----------+----------+
と、初期状態ではパスワード無し、ユーザー無しなので
空欄ユーザーは削除、rootにはパスワードを設定する。
DELETE FROM user where user='';
DELETE FROM user where user='root' and host='hostname';
GRANT ALL on *.* to root@"%" identified by 'hogehoge' wi...
SET PASSWORD FOR root@127.0.0.1 = PASSWORD('hogehoge');
FLUSH PRIVILEGES;
など。
***my.cnf [#zd0eb4b5]
未精査につき注意。
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
[mysqld]
## IPアドレスバインドやポート指定など
port = 3306
bind-address = xxx.xxx.xxx.xxx
#
## 何はともあれ設定
socket = /tmp/mysql.sock
#
## デフォルト文字コード設定
character-set-server = utf8
#
## 内蔵InnoDBは使わず、プラグインのInnoDBを使用する
ignore-builtin-innodb
plugin-load=innodb=ha_innodb_plugin.so
#
skip-external-locking
#skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
#
## ローカルでsocket通信しか行わないならアンコメント
#skip-networking
#
## SSLを有効にする(SSL Readyにするだけ)
ssl
#
## 実際には以下のパラメータが必要
#ssl_ca =
#ssl_capath =
#ssl_cert =
#ssl_cipher =
#ssl_key =
#
# Replication Master Server (default)
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
#master-host =
#master-user =
#master-password =
#master-port =
#master-connect-retry =
#master-ssl =
#master-ssl-ca =
#master-ssl-capath =
#master-ssl-cert =
#master-ssl-cipher =
#master-ssl-key =
[mysqldump]
skip-opt
create-options
default-character-set=binary
hex-blob
max_allowed_packet = 16M
master-data
quick
set-charset
single-transaction
[mysql]
no-auto-rehash
# Remove the next comment character if you are not famil...
#safe-updates
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
ページ名: