mysql个人知识点

mysql安装

2017-09-30  本文已影响0人  莫军

Centos7 安装 mysql5.7

官方: yum源添加

wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
yum install mysql-community-server
service mysqld start  
# 或者 /bin/systemctl start  mysqld
less /var/log/mysqld.log
    # 密码信息: A temporary password is generated for root@localhost: Ca:hf7D8YuG;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
# 需要重新设置密码
SET PASSWORD = PASSWORD('123abcC!');

添加测试用户:
grant all on . TO 'tmp'@'%' IDENTIFIED BY 'tmp';
查看mysql运行状态 systemctl status mysqld.service
查看mysql运行状态 journalctl -xe

grant all on *.* TO 'tmp'@'%' IDENTIFIED BY 'tmp';
CREATE USER 'read'@'%' IDENTIFIED BY 'read';
grant select on *.* to 'read'@'%' ;
flush privileges;
上一篇 下一篇

猜你喜欢

热点阅读