CentOS 7源码编译安装MySQL 8.0(2)

#*********** Logs related settings ***********
log-bin = /data/mysqldata/3306/binlog/mysql-bin
binlog_format= mixed
binlog_cache_size=32m
max_binlog_cache_size=64m
max_binlog_size=512m
long_query_time = 1
log_output = FILE
log-error = /data/mysqldata/3306/mysql-error.log
slow_query_log = 1
slow_query_log_file = /data/mysqldata/3306/slow_statement.log
#log_queries_not_using_indexes
general_log = 0
general_log_file = /data/mysqldata/3306/general_statement.log
#expire-logs-days = 14
binlog_expire_logs_seconds = 1728000
relay-log = /data/mysqldata/3306/binlog/relay-bin
relay-log-index = /data/mysqldata/3306/binlog/relay-bin.index
#****** MySQL Replication New Feature*********
master-info-repository=TABLE
relay-log-info-repository=TABLE
relay-log-recovery
#*********** INNODB Specific options ***********
innodb_buffer_pool_size = 2048M
transaction-isolation=REPEATABLE-READ
innodb_buffer_pool_instances = 8
innodb_file_per_table = 1
innodb_data_home_dir = /data/mysqldata/3306/innodb_ts
innodb_data_file_path = ibdata1:2048M:autoextend
innodb_thread_concurrency = 8
innodb_log_buffer_size = 16M
innodb_log_file_size = 128M
innodb_log_files_in_group = 3
innodb_log_group_home_dir = /data/mysqldata/3306/innodb_log
innodb_flush_log_at_trx_commit = 2
innodb_max_dirty_pages_pct = 70
innodb_flush_method=O_DIRECT
[mysql]
no-auto-rehash
default-character-set=gbk
prompt = (\u@\h) [\d]>\_

9.初始化MySQL数据库

$/usr/local/mysql/bin/mysqld --defaults-file=/data/mysqldata/3306/my.cnf --initialize --user=mysql

10.启动mysql服务

$/usr/local/mysql/bin/mysqld_safe --defaults-file=/data/mysqldata/3306/my.cnf --user=mysql &

11.登陆数据库

备注:密码来自于error log日志,明细如下:
2018-05-16T07:17:57.335486Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: j<ds.k;9j8ra

$/usr/local/mysql/bin/mysql -uroot -p'j<ds.k;9j8ra'

12.数据库一些基本权限配置

•修改root账号密码:

ALTER USER 'root'@'localhost' IDENTIFIED WITH sha256_password BY 'zsd@7101' PASSWORD EXPIRE INTERVAL 360 DAY;

•查看目前的用户账号

(root@localhost) [(none)]> select user,host from mysql.user;
+------------------+-----------+
| user            | host      |
+------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root            | localhost |
+------------------+-----------+

Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/232c0fae9cf13e671035f7b41fc30ef2.html