cd /usr/local/src
rpm -ihv
mysql-community-release-el6-5.noarch.rpm
yum -y install mysql-community-server
chkconfig mysqld on
service mysqld start
mysql -uroot -p
SET PASSWORD FOR root@localhost=PASSWORD('password');
exit;
参照
/usr/bin/mysql_secure_installation
service mysql start
mysql -uroot -p
SET PASSWORD FOR root@localhost=PASSWORD('password');
exit;
mysql --version
mysql -uroot -pCreate Database testdb;
grant all privileges on *.* to usr1 identified by 'Passwd6';
FLUSH PRIVILEGES;
show grants;SHOW variables like 'character_set%';
find /* -name my*.cnf
gedit /etc/my.cnf
Create Database testdb CHRACTER SET utf8; <ー『データベース作成』
Drop Database test; <ー『 デフォルトのテストデータベース削除』
DMLユーザー(データ操作)
grant create,drop,alter,select,update,insert,delete on *.* to usr1 identified by 'mysql_password'; <ー『 ユーザーの
作成』
DDLユーザー(データ定義)
grant all privileges on *.* to usr10 identified by 'mysql_password'; <ー『 ユーザーの作成』
grant all privileges on table_name to usr10 identified by 'mysql_password'; <ー『 テーブル毎のユーザーの作成』
FLUSH PRIVILEGES;
show grants;
SHOW variables like 'character_set%';
show grants;SHOW variables like 'character_set%';
[client]
port=3306
default-character-set = utf8
[mysqld]
port=3306
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_general_ci
# init-connect = SET NAMES utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
# Server Id.
server-id=1
max_connections=151
query_cache_size=1M
table_open_cache=2000
tmp_table_size=57M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=104M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_additional_mem_pool_size=8M
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
query_cache_type=1
sort_buffer_size=256K
[mysqldump]
default-character-set = utf8
[mysql]
default-character-set = utf8
[mysqld]
default-character-set=utf8
default-storage-engine=INNODB
init_connect='SET autocommit=0'
datadir=/var/lib/mysql
tmpdir=/var/tmp/mysql
port=3306
socket=/var/lib/mysql/mysql.sock
max_connections=100
table_open_cache=2000
table_definition_cache=200
key_buffer_size=8M
read_buffer_size=128K
read_rnd_buffer_size=512K
join_buffer_size=256K
log_bin=mysql-bin
binlog_format=MIXED
max_binlog_size=64M
expire_logs_days=15
server_id=1
slow_query_log_file="MYSQL-slow.log"
long_query_time=5
log_queries_not_using_indexes
innodb_open_files=500
innodb_buffer_pool_size=1G
innodb_buffer_pool_instances=8
innodb_additional_mem_pool_size=4M
innodb_file_per_table=1
innodb_autoextend_increment=64M
innodb_log_files_in_group=2
innodb_log_file_size=48M
innodb_log_buffer_size=2M
innodb_flush_log_at_trx_commit=1
innodb_flush_method=O_DIRECT
innodb_thread_concurrency=16
innodb_commit_concurrency=10
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_stats_on_metadata=0
innodb_checksum_algorithm=0
back_log=70
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4110
query_cache_type=1
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
default-character-set=utf8
default-storage-engine=INNODB
init_connect='SET autocommit=0'
datadir=/var/lib/mysql
tmpdir=/var/tmp/mysql
port=3306
socket=/var/lib/mysql/mysql.sock
max_connections=100
table_open_cache=2000
table_definition_cache=200
key_buffer_size=8M
read_buffer_size=128K
read_rnd_buffer_size=512K
join_buffer_size=256K
log_bin=mysql-bin
binlog_format=MIXED
max_binlog_size=64M
expire_logs_days=15
server_id=1
slow_query_log_file="MYSQL-slow.log"
long_query_time=5
log_queries_not_using_indexes
innodb_open_files=500
innodb_buffer_pool_size=1G
innodb_buffer_pool_instances=8
innodb_additional_mem_pool_size=4M
innodb_file_per_table=1
innodb_autoextend_increment=64M
innodb_log_files_in_group=2
innodb_log_file_size=48M
innodb_log_buffer_size=2M
innodb_flush_log_at_trx_commit=1
innodb_flush_method=O_DIRECT
innodb_thread_concurrency=16
innodb_commit_concurrency=10
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_stats_on_metadata=0
innodb_checksum_algorithm=0
back_log=70
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4110
query_cache_type=1
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー