标签:oca lib default nod init.d glib 安装mysql xpl create
# cd /root
# wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz
# mkdir -p /usr/local/mysql5.6
# mkdir -p /data/mysql5.6
# tar xf mysql-5.6.37-linux-glibc2.12-x86_64.tar.gz
# mv mysql-5.6.37-linux-glibc2.12-x86_64 /usr/local/mysql5.6
# groupadd mysql
# useradd -r -g mysql mysql
# chown -R mysql:mysql /usr/local/mysql5.6
# chown -R mysql:mysql /data/mysql5.6
# /usr/local/mysql5.6/scripts/mysql_install_db --user=mysql --datadir=/data/mysql5.6/ --basedir=/usr/local/mysql5.6/
# cat /usr/local/mysql5.6/my.cnf
[mysqld]
basedir = /usr/local/mysql5.6/
datadir = /data/mysql5.6/
port = 3307
socket = /data/mysql5.6/mysql.sock
innodb_file_per_table=1
default-storage-engine=INNODB
explicit_defaults_for_timestamp=true
symbolic-links=0
max_connections=1000
[mysqld_safe]
log-error=/data/mysql5.6/mysqld.log
pid-file=/data/mysql5.6/mysqld.pid
# mv /etc/my.cnf /etc/my.cnfbak
# cp /usr/local/mysql5.6/my.cnf /etc/my.cnf
# vim /etc/profile
export MYSQL_HOME="/usr/local/mysql5.6/"
export PATH="$PATH:$MYSQL_HOME/bin"
# source /etc/profile
# cp /usr/local/mysql5.6/support-files/mysql.server /etc/init.d/mysql5.6
# chkconfig --add mysql5.6
# chkconfig mysql5.6 on
# service mysql5.6 start
# /usr/local/mysql5.6/bin/mysqld_safe --user=mysql --defaults-file=/usr/local/mysql5.6/my.cnf --datadir=/data/mysql5.6/ --basedir=/usr/local/mysql5.6/ &
# ln -s /data/mysql5.6/mysql.sock /tmp/mysql.sock
# /usr/local/mysql5.6/bin/mysql -uroot -P3307
mysql> CREATE USER ‘root‘@‘%‘ IDENTIFIED BY ‘password‘;
mysql> GRANT ALL PRIVILEGES ON *.* TO‘root‘@‘%‘ IDENTIFIED BY ‘password‘ WITH GRANT OPTION;
mysql> update mysql.user set password=password(‘password‘) where User="root" and Host="localhost";
mysql> update mysql.user set password=password(‘password‘) where User="root" and Host="127.0.0.1";
mysql> update mysql.user set password=password(‘password‘) where User="root" and Host="hostname";
mysql> update mysql.user set password=password(‘password‘) where User="root" and Host="::1";
mysql> flush privileges;
标签:oca lib default nod init.d glib 安装mysql xpl create
原文地址:https://www.cnblogs.com/doublexi/p/8761027.html