linux vim卸载安装包_Linux下卸载安装mysql

1、卸载命令:# rpm -qa |grep -i mysql

# yum remove mysql-community mysql-community-server mysql-community-libs mysql-community-common

2、安装:# wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

# yum localinstall mysql57-community-release-el7-8.noarch.rpm

# yum install mysql-community-server

3、启动 :# systemctl start mysqld

重启:# systemctl restart mysqld

关闭:# systemctl stop mysqld

设置开机自启 # systemctl enable mysqld

# systemctl daemon-reload

4、查看默认密码:# grep ‘temporary password‘ /var/log/mysqld.log

注:可修改密码策略(不然密码需要包括大小写、数字、特殊符号)

# vim  /etc/my.cnf

添加:validate_password = off

# systemctl restart mysqld

5、登录:#  mysql -uroot -p

修改密码:mysql> set password for ‘root‘@‘localhost‘=password(‘123123‘);

添加远程账号:mysql> GRANT ALL PRIVILEGES ON *.* TO ‘home‘@‘%‘ IDENTIFIED BY ‘123123‘ WITH GRANT OPTION;

7、配置默认编码utf-8:# vim /etc/my.cnf

添加:   character_set_server=utf8

init_connect=‘SET NAMES utf8‘

8、默认配置文件路径:

配置文件:/etc/my.cnf

日志文件:/var/log//var/log/mysqld.log

服务启动脚本:/usr/lib/systemd/system/mysqld.service

socket文件:/var/run/mysqld/mysqld.pid

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值