赞
踩
进入 mysql 下载列表
https://dev.mysql.com/downloads/mysql/
cd /usr/local/src
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-boost-8.0.18.tar.gz
#安装依赖包
apt install build-essential cmake bison libncurses5-dev libssl-dev pkg-config
#make
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DWITH_BOOST=boost -DFORCE_INSOURCE_BUILD=ON &
make && make install
groupadd mysql
useradd -g mysql mysql
mkdir -p /usr/local/mysql/data
chown -R mysql:mysql /usr/local/mysql
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
#这一步会打印输出随机生成的root账号初始密码ru。
配置 my.cnf
vim /etc/my.cnf
# 然后写入以下内容 #
[client]
socket = /tmp/mysql.sock
[mysqld]
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
配置 服务项
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
update-rc.d mysqld defaults
service mysqld start
echo -e '# MySQL PATH\nexport PATH=/usr/local/mysql/bin:$PATH\n' >> /etc/profile
source /etc/profile
mysql -uroot -p'Ej0cJ?VA<npl'
ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; #更新一下用户的密码
FLUSH PRIVILEGES; #刷新权限
alter user 'root'@'%' identified by '123456';#重置密码,666666就是变更后的密码,自己的密码自己更改下哦
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
mysql -uroot -hlocalhost -p'123456'
systemctl start mysqld #
systemctl stop mysqld
systemctl restart mysqld
内存1g以下的会在make的时候停止: linux 启用虚拟内存
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。