标签:word .gz 编辑 home pass 基础 pts you 开机自启动
以下所有操作都基于centos6.9
rpm -qa | grep mysql
yum remove mysql-libs-5.1.73-8.el6_8.x86_64
mysql-5.6.41.tar.gz
tar -xzvf mysql-5.6.41.tar.gz -C /ddhome/bin
mv mysql-5.6.41 mysql
groupadd mysql
useradd -g mysql mysql
usermod mysql -G root
# 查看mysql用户
id mysql
# 修改mysql目录
chown -R mysql:mysql mysql/
# 创建db目录
mkdir -p mysql/data/mydb
# 安装
mysql/scripts/mysql_install_db --user=mysql --basedir=/ddhome/bin/mysql --datadir=/ddhome/bin/mysql/data/mydb/
# 拷贝my.cnf
cp mysql/my.cnf /etc/my.cnf
# 创建软链接
ln -s /ddhome/bin/mysql/bin/mysql /usr/bin/mysql
# 拷贝mysql服务文件
cp mysql/support-files/mysql.server /etc/init.d/mysqld
编辑/etc/my.cnf
basedir = /ddhome/bin/mysql
datadir = /ddhome/bin/mysql/data/mydb
port = 3306
server_id = 1
/etc/init.d/mysqld start
chkconfig mysqld on
use mysql;
UPDATE user SET Password = password ( ‘新密码‘ ) WHERE User = ‘root‘ ;
# 授权远程登录
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘your_root_password‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
标签:word .gz 编辑 home pass 基础 pts you 开机自启动
原文地址:https://www.cnblogs.com/dzqk/p/9534251.html