阿小信大人的头像
Where there is a Python, there is a way. 阿小信大人

centOS安装mysql2015-09-24 18:11

安装mysql

下载 http://dev.mysql.com/downloads/mysql/

sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
sudo yum install mysql-server
service mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
> use mysql;
> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
> flush privileges;
> quit
sudo pkill mysql
service mysql start

恢复被删除的root用户

service mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
> use mysql;
> flush privileges;
> grant all privileges on *.* to root@'localhost' identified by 'pwd' with grant option;
> flush privileges;
> quit

创建用户

CREATE USER 'crowd'@'localhost' IDENTIFIED BY 'crowd@123';
GRANT ALL PRIVILEGES ON *.* TO 'crowd'@'localhost' with grant option;
# 允许远程连接
CREATE USER 'crowd'@'%' IDENTIFIED BY 'crowd@123';
GRANT ALL PRIVILEGES ON *.* TO 'crowd'@'%' with grant option;

如果您觉得从我的分享中得到了帮助,并且希望我的博客持续发展下去,请点击支付宝捐赠,谢谢!

若非特别声明,文章均为阿小信的个人笔记,转载请注明出处。文章如有侵权内容,请联系我,我会及时删除。

#Linux/Mac#   #mysql
分享到:
阅读[991] 评论[0]

你可能也感兴趣的文章推荐

本文最近访客

发表评论