查看系统中安装的rpm包rpm -qa | grep Mysql卸载自带的mysqlrpm -e --nodeps * 解压mysqltar -xv
查看系统中安装的rpm包
rpm -qa | grep Mysql
卸载自带的mysql
解压mysql
mysql-commUnity-common-5.7.18-1.el7.x86_64.rpm
mysql-community-libs-5.7.18-1.el7.x86_64.rpm(依赖于common)
mysql-community-client-5.7.18-1.el7.x86_64.rpm(依赖于libs)
mysql-community-server-5.7.18-1.el7.x86_64.rpm(依赖于common,client)
mysql-community-devel-5.7.18-1.el7.x86_64.rpm(MySQL头文件和库文件)
mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm
强制卸载
rpm -e --nodeps mariadb-libs-5.5.41-2.el7_0.x86_64
在文件尾部添加
character_set_server=utf8 --设置字符集
init_connect='SET NAMES utf8'
lower_case_table_names=1 --忽略大小写
skip-grant-tables=1 --无密码方式进入mysql
然后输入 mysql -u root
use mysql;
update user set authentication_string = password('***'),
passWord_expired='N',password_last_changed = now() where user ='root'; FLUSH PRIVILEGES;
退出数据库
exit
把添加的配置文件的一行删掉,光标移动到最下面,按“i”键,删除skip-grant-tables=1
mysql -u root -p**
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '**' WITH GRANT OPTION; --绝对不能少的一步;
CREATE DATABASE `**` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
--结束END--
本文标题: mysql安装rpm方式
本文链接: https://lsjlt.com/news/37113.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0