1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| yum install autoconf make perl show VARIABLES like '%datadir%' rpm -qa|grep mysql rpm -e --nodeps qt5-qtbase-mysql-5.11.1-13.p01.ky10.x86_64 rpm -e --nodeps python2-mysqlclient-1.3.12-8.ky10.x86_64 groupadd mysql useradd -g mysql mysql tar -zxvf mysql-5.6.50-linux-glibc2.12-x86_64.tar.gz mv mysql-5.6.50-linux-glibc2.12-x86_64 /usr/local/mysql chown -R mysql:mysql /usr/local/mysql chmod -R 755 /usr/local/mysql/ mkdir /usr/local/mysql/data vi /etc/my.cnf [mysqld] socket=/usr/local/mysql/data/mysql.sock datadir=/usr/local/mysql/data lower_case_table_names=1 port=3306 pid-file = /usr/local/mysql/data/mysql.pid user=mysql character-set-server = utf8 open_files_limit = 65535 max_connect_errors = 6000 max_connections=2000 # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd sort_buffer_size = 64M read_buffer_size = 64M read_rnd_buffer_size = 32M table_open_cache = 51200 table_definition_cache=51200 max_allowed_packet = 64M tmp_table_size = 16G innodb_buffer_pool_size = 400G innodb_additional_mem_pool_size = 1024M group_concat_max_len = 102400 innodb_file_per_table=1 innodb_open_files = 51200 sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' #innodb_write_io_threads=16 #innodb_read_io_threads=16 #skip-grant-tables [mysqld_safe] #innodb_write_io_threads=32 #innodb_read_io_threads=32 log-error=/mysql/my3306/data/mysql_error.log [client] port=3306 socket=/usr/local/mysql/data/mysql.sock # # include all files from the config directory # !includedir /etc/my.cnf.d #sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' cd /usr/local/mysql/scripts/ ./mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data --user=mysql cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql mkdir -p /mysql/my3306/data/ chown -R mysql:mysql /mysql touch /mysql/my3306/data/mysql_error.log service mysql start mysql -u root update mysql.user set password=password('xxxx') , host='%' where host='127.0.0.1' and user='root'; update mysql.user set password=password('xxxx') where host='localhost' and user='root'; flush privileges; mysqldump -uroot -pxxxx --force --quick --all-databases >/home/mysql/alldata.sql source alldata.sql grant all privileges on *.* to root@"%" identified by "xxxx"; flush privileges;
|