MySQL install

数据库 waitig 478℃ 百度已收录 0评论
ls mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz  #mysql版本
tar -zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz  #解压mysql
mv mysql-5.6.33-linux-glibc2.5-x86_64 /usr/local/mysql  #移动到/usr/local/
cd /usr/local/mysql/

#添加mysql用户组和用户
groupadd mysql
useradd -g mysql mysql

mkdir ./data/mysql
chown -R mysql:mysql ./
./scripts/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data/mysql
cp support-files/mysql.server /etc/init.d/mysqld
cp support-files/my-default.cnf /etc/my.cnf

vim /etc/init.d/mysqld 
#修改项
basedir=/usr/local/mysql/
datadir=/usr/local/mysql/data/mysql

service mysqld start  #启动失败

ps -aux|grep mysqld  #已启动mysqld??
kill -9 12212  #杀死mysql用户的mysqld启动
service mysqld start  #启动成功

#vim /etc/profile
export PATH=$PATH:/usr/local/mysql//bin  #添加环境变量
source /etc/profile

service命令

service start
service stop
service status
service restart

本文由【waitig】发表在等英博客
本文固定链接:MySQL install
欢迎关注本站官方公众号,每日都有干货分享!
等英博客官方公众号
点赞 (0)分享 (0)