mysql安装
tar zxvf mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz
mv mysql-5.7.27-linux-glibc2.12-x86_64 /usr/local/ cd /usr/local/ mv mysql-5.7.27-linux-glibc2.12-x86_64 mysql mkdir /usr/local/mysql/data
chown -R mysql:mysql /usr/local/mysql chmod -R 755 /usr/local/mysql
cd /usr/local/mysql/bin
./mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
vi /etc/my.cnf
[mysqld] datadir=/usr/local/mysql/data port=3306 socket=/tmp/mysql.sock basedir=/usr/local/mysql character-set-server=utf8 user=root group_concat_max_len=-1 lower_case_table_names=1 innodb_file_per_table=on innodb_lock_wait_timeout=120 innodb_buffer_pool_size=1G innodb_log_buffer_size=16M innodb_thread_concurrency=16 # 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 [mysqldump] quick max_allowed_packet=32M [mysqld_safe] #log-error=/var/log/mariadb/mariadb.log #pid-file=/var/run/mariadb/mariadb.pid [client] loose-default-character-set=utf8
/usr/local/mysql/support-files/mysql.server start
ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql service mysql restart
mysql -u root -p set password for root@localhost = password('xxxb_cqq');
use mysql; update user set user.Host='%' where user.User='root'; flush privileges;
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld chmod +x /etc/init.d/mysqld chkconfig --add mysqld chkconfig --list
https://www.jianshu.com/p/276d59cbc529