linux版本:CentOS7 64位
1、下载安装包“mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz”
# 安装依赖
yum -y install perl perl-devel autoconf libaio
2、把下载的安装包移动到/usr/local/下。
3、解压
tar zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
4、复制解压后的mysql目录到系统的本地软件目录
cp mysql-5.6.33-linux-glibc2.5-x86_64 /usr/local/mysql -r
5、添加系统mysql组和mysql用户
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
注意:Because the user is required only for ownership purposes, not login purposes, the useradd command uses the -r and -s /bin/false options to create a user that does not have login permissions to your server host. Omit these options if your useradd does not support them.
6、进入安装mysql软件目录,修改目录拥有者为mysql用户
cd mysql/
chown -R mysql:mysql ./
7、安装数据库,此处可能出现错误。
./scripts/mysql_install_db –user=mysql
FATAL ERROR: please install the following Perl modules before executing scripts/mysql_install_db:
Data::Dumper
#解决方法:
yum install -y perl-Data-Dumper
8、修改当前目录拥有者为root用户
chown -R root:root ./
9、修改当前data目录拥有者为mysql用户
chown -R mysql:mysql data
============== 到此数据库安装完毕 =============
10、添加mysql服务开机自启动
添加开机启动,把启动脚本放到开机初始化目录。
###################### 分割线 ######################
权限控制
1、去除匿名用户
# 测试匿名用户登录
mysql -ux3
再次测试匿名用户登录

文章知识点与官方知识档案匹配,可进一步学习相关知识MySQL入门技能树安装和登录安装31839 人正在系统学习中 相关资源:陈式太极拳教学软件+注册机1-专业指导文档类资源-CSDN文库
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!