mysql_privileges

原文链接:https://blog.csdn.net/gdolphinw/article/details/89568136
——————————————————————————————————————————————————————
yum安装mysql5.7
yum list |grep mysql
rpm -qa|grep maria 找出所有关于mariaDB的安装包
yum remove -y maria* 在后面加上上面的包名删除
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装这个包后,会获得两个mysql的yum repo源
/etc/yum.repos.d/mysql-community.repo
/etc/yum.repos.d/mysql-community-source.repo.
yum install mysql-server –nodeps –force
systemctl start mysqld 启动mysql服务
systemctl enable mysql 设置mysql开机启动
——————————————————————————————————————————————————————
mysql5.6改root密码:
update mysql.user set password=PASSWORD(‘shimujiuxia’) where User=’root’;
flush privileges;
给远程用户权限
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘shimujiuxia’;
flush privileges;
——————————————————————————————————————————————————————
MySQL目录
mysql数据库的data目录 /var/lib/mysql/
mysql头文件:/usr/include/mysql/
mysql可执行文件: /usr/bin/
mysql库文件:/usr/lib64/mysql
mysql日志文件:/var/log/mysqld.log
——————————————————————————————————————————————————————
mysql8.0改密码:
alter user ‘root’@’localhost’ identified by ‘shimujiuxia’;
任意地址
create user ‘root’@’%’ identified by ‘shimujiuxia’;
grant all on . to ‘root’@’%’;
alter user ‘root’@’%’ identified with mysql_native_password by ‘shimujiuxia’;
删除用户及权限
delete from user where user=’root’ and host=’%’;
revoke all privileges on . from ‘root’@’localhost’;
创建数据库设置编码
create database lei default charset utf8 collate utf8_general_ci;
——————————————————————————————————————————————————————
问题:Collation error The database collation ‘utf8_general_ci’ is not supported by Confluence. You need to use ‘utf8_bin’.
解决方法:
create database confluence character set utf8 collate utf8_bin;
grant all on confluence. to ‘confluenceuser’@’%’ identified by ‘password’ with grant option;
grant all on confluence. to ‘confluenceuser’@localhost identified by ‘password’ with grant option;
flush privileges;
——————————————————————————————————————————————————————

posted @ 2022-07-01 16:01  leiuk  阅读(162)  评论(0编辑  收藏  举报