系统版本:centOS7.6
wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.47-linux-glibc2.12-x86_64.tar.gz
yum -y install mysql
yum -y install autoconf
yum -y install libaio*
yum -y install openssl-1.0.2k-16.el7_6.1.x86_64
yum -y install php-mysql
#把mysql文件放至opt目录下
mv mysql-5.6.47 /opt/
#创建mysql链接
cd /usr/local/
ln -s /opt/mysql-5.6.47/ mysql
cd mysql
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
scripts/mysql_install_db --user=mysql
bin/mysqld_safe --user=mysql &
ps -ef |grep mysqld
./bin/mysqladmin -u root -p password '密码'
mysql -u root -p
find / -name mysql.sock
cp my.cnf /etc/
vim my.cnf
#新增节点
[client]
socket=/tmp/mysql.sock
mysql -u root -p
#创建php文件测试数据库连接
#报错解决:
mkdir /var/log/mariadb
touch /var/log/mariadb/mariadb.log
chown -R mysql /var/log/mariadb/
./support-files/mysql.server start
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock