• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

简单几步在Linux环境下安装MySQL5.7(附踩坑记录)


wings

Recommended Posts

在Linux下安装MySQL可以说是每个开发者必备的知识
刚好我的服务器重装了一下 因此重新安装了MySQL 写下本文特此记录

下载MySQL的压缩包:
官网:https://dev.mysql.com/downloads/mysql/5.6.html#downloads

根据自己的情况选择一个版本的MySQL下载即可(下载速度会比较慢)
下载完之后 传到服务器上(传的也会比较慢)

注:32位还是64位一定要选对 否则后面会出错

解压和移动
输入:

tar -xvf mysql-5.7.30-linux-glibc2.12-i686.tar.gz(实际下载的压缩文件名称)

移动到/usr/local/下并改名:

mv mysql-5.7.26-linux-glibc2.12-x86_64 /usr/local/mysql

权限配置
创建名为mysql的权限组和用户
输入:

groupadd mysql
useradd -r -g mysql mysql

参数:
-d:指定用户登入时的起始目录
-r:建立系统账号

然后在根目录下创建数据目录:

cd /
mkdir -p /data/mysql

授权:

chown mysql:mysql -R /data/mysql

(将/data下的mysql的用户组改成mysql用户组下面的mysql用户)
————————————————
版权声明:本文为CSDN博主「Piconjo_Official」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Piconjo/article/details/105818038

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now