mysql安装

二进制安装 Installing MySQL on Unix/Linux Using Generic Binaries

1.下载
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz

2.解压并移动到目标目录

tar -zxf mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz; 
mv mysql-5.7.26-linux-glibc2.12-x86_64 /usr/local/mysql

3.安装依赖

yum install libaio

4.安装

注意修改启动脚本mysql.server和配置文件/etc/my.cnf中的datadir,basedir

// 创建mysql用户
groupadd mysql
useradd -r -g mysql -s /bin/false mysql

// 初始化 https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html
cd /usr/local/mysql/
mkdir mysql-files
chown mysql:mysql mysql-files
chmod 750 mysql-files
./bin/mysqld --initialize-insecure --user=mysql //根据/etc/my.cnf初始化data目录
./bin/mysql_ssl_rsa_setup              
./bin/mysqld_safe --user=mysql &
# Next command is optional
cp support-files/mysql.server /etc/init.d/mysqld //启动脚本
chkconfig --add mysqld //开机启动(chkconfig --list检查。)

5.启动mysql服务端
service mysqld start

6.修改密码

a.mysql -u root -p 直接回车连上mysql.

b. 修改密码
update mysql.user set authentication_string=password('1234') where user='root';
flush privileges;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值