linux 下安装mysql5.7.13
1、检查是否已经安装了mysql
rpm -qa | grep mysql
2、删除mysql,保留依赖包
rpm -e mysql-xxxxx --nodeps
3、创建用户组、用户
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
4、更改用户所属用户、用户组
chown -R mysql .
chgrp -R mysql .
5、安装和初始化数据库
bin/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
6、拷贝配置文件、服务启动文件
cp -a ./support-files/my-default.cnf /etc/my.cnf
cp -a ./support-files/mysql.server /etc/init.d/mysqld
7、重启msql服务
cd bin/
./mysqld_safe --user=mysql &
/etc/init.d/mysqld restart
8、登录mysql服务
cat /root/.mysql_secret
./mysql -uroot -p
9、修改密码
SET PASSWORD = PASSWORD('root');
flush privileges;
10、添加远程访问权限
use mysql;
update user set host = '%' where user = 'root';
11、重启生效
/etc/init.d/mysqld restart
相关推荐
yaodilu 2020-05-10
SXIAOYI 2020-09-16
有心就有方向 2012-09-03
zfyaixue 2013-06-14
pigsmall 2020-11-19
Ladyseven 2020-07-25
whileinsist 2020-06-24
gufudhn 2020-06-12
冰蝶 2020-06-05
LinuxAndroidAI 2020-06-04
supperme 2020-05-28
e度空间 2020-04-27
云端漂移 2020-04-09
peterwzc 2020-03-17
ebuild 2013-05-14
donghedonghe 2013-05-31
tdeclipse 2011-02-28
linuxprobe0 2013-04-15