?
?
rm -rf /u01/my3306/data/* rm -rf /u01/my3306/log/iblog/* rm -rf /u01/my3306/log/binlog/* chmod -R 777 /u01/my3306/data/ chmod -R 777 /u01/my3306/log/iblog/ chmod -R 777 /u01/my3306/log/binlog/ chmod 755 /u01/my3306/my.cnf ./scripts/mysql_install_db --defaults-file=/u01/my3306/my.cnf --datadir=/u01/my3306/data --user=mysql chmod -R 777 /u01/my3306/data/ chmod -R 777 /u01/my3306/log/iblog/ chmod -R 777 /u01/my3306/log/binlog/说明:defaults-file表示指定默认的配置文件,如果不指定,系统默认的优先级是先使用/etc/my.cnf作为mysql的配置文件,那之前make的那些参数就白设置了.
?
?
?
十三、启动mysql
vi .bash_profile ---root用户下添加 PATH=$PATH:$HOME/bin:/u01/my3306/bin mysqld_safe --defaults-file=/u01/my3306/my.cnf --user=mysql &
?
?
[root@uubee8 ~]# mysql -h127.0.0.1 -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.23-log Source distribution Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like '%log-bin%'; Empty set (0.00 sec) mysql> show variables like '%bin%'; +-----------------------------------------+------------------------------+ | Variable_name | Value | +-----------------------------------------+------------------------------+ | bind_address | * | | binlog_cache_size | 32768 | | binlog_checksum | CRC32 | | binlog_direct_non_transactional_updates | OFF | | binlog_error_action | IGNORE_ERROR | | binlog_format | ROW | | binlog_gtid_simple_recovery | OFF | | binlog_max_flush_queue_time | 0 | | binlog_order_commits | ON | | binlog_row_image | FULL | | binlog_rows_query_log_events | OFF | | binlog_stmt_cache_size | 32768 | | binlogging_impossible_mode | IGNORE_ERROR | | innodb_api_enable_binlog | OFF | | innodb_locks_unsafe_for_binlog | OFF | | log_bin | ON | | log_bin_basename | /u01/my3306/log/binlog | | log_bin_index | /u01/my3306/log/binlog.index | | log_bin_trust_function_creators | OFF | | log_bin_use_v1_row_events | OFF | | max_binlog_cache_size | 2147483648 | | max_binlog_size | 524288000 | | max_binlog_stmt_cache_size | 18446744073709547520 | | simplified_binlog_gtid_recovery | OFF | | sql_log_bin | ON | | sync_binlog | 100 | +-----------------------------------------+------------------------------+ 26 rows in set (0.00 sec)
##################################################################################################################################
?
?
1.初始化MySQL脚本: sh init3306.sh rm -rf /u01/my3306/data/* rm -rf /u01/my3306/log/iblog/* rm -rf /u01/my3306/log/binlog/* chmod -R 777 /u01/my3306/data/ chmod -R 777 /u01/my3306/log/iblog/ chmod -R 777 /u01/my3306/log/binlog/ chmod 755 /u01/my3306/my.cnf ./scripts/mysql_install_db --defa