LNMP_mysql安装_1
cd /usr/local/src
wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.31-linux-glibc2.5-x86_64.tar.gz
tar zxvf mysql-5.6.29-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.29-linux-glibc2.5-x86_64 /usr/local/mysql
useradd -s /sbin/nologin mysql
cd /usr/local/mysql
mkdir -p /data/mysql ; chown -R mysql:mysql /data/mysql
./scripts/mysql_install_db --user=mysql --datadir=/data/mysql
cp support-files/my-default.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
vim /etc/init.d/mysqld #修改datadir
chkconfig --add mysqld
chkconfig mysqld on
service mysqld start
错误:
yum install -y libaio
ERROR 2002 (HY000): Can't connect to local MySQLserver through socket '/var/lib/mysql/mysql.sock' (2)
这里要检查这里
cp support-files/my-default.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chmod 755 /etc/init.d/mysqld
vim /etc/init.d/mysqld #修改datadir
//添加path路径
export PATH=$PATH:/usr/local/mysql/bin/
#vi ~/.bash_profile
PATH=/usr/local/mysql/bin:$PATH:$HOME/bin
转载于:https://blog.51cto.com/68686789/1832228