标签:sql_mod ice 创建文件夹 min add set native eve ble
下载 mysql-8.0.15-el7-x86_64
解压到指定目录
/application
创建文件夹
/application/mysql/data
/application/mysql/logs
创建mysql用户 、组
groupadd mysql 和 useradd -r -g mysql mysql
初始化数据库
yum -y install numactl
./mysqld --initialize --user=mysql --basedir=/application/mysql/ --datadir=/application/mysql/data
vim /etc/my.conf
[mysqld]
basedir=/application/mysql
datadir=/application/mysql/data
port=3306
socket=/tmp/mysql.sock
pid-file=/application/mysql/python.pid
log-error=/application/mysql/logs/error.log
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
配置mysql环境变量
vim /etc/profile // 打开profile文件
export MYSQL_HOME
MYSQL_HOME=/application/mysql
export PATH=$PATH:$MYSQL_HOME/lib:$MYSQL_HOME/bin
修改mysql 目录权限为mysql
chown -R mysql.mysql mysql
设置开机启动
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld //添加可执行权限。
sed -i ‘s#/usr/local/mysql#/application/mysql#g‘ /etc/init.d/mysqld 替换路径
chkconfig --add mysqld // 注册启动服务
chkconfig --list 查看
启动
service mysql start //开启服务器。
mysql -uroot -p //登录进入mysql,然后提示输入密码。
(3)修改mysql用户密码为admin
mysql>ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘admin‘;
(4)修改root用户密码永不过期
mysql>ALTER USER ‘root‘@‘localhost‘ PASSWORD EXPIRE NEVER;
(5)修改root用户可以远程连接
mysql>use mysql;
mysql> update mysql.user set host=‘%‘ where user=‘root‘;
(6)刷新权限
mysql>flush privileges;
---------------------
标签:sql_mod ice 创建文件夹 min add set native eve ble
原文地址:https://www.cnblogs.com/zdqc/p/10954597.html