Linux上mysql安装及配置

Linux上mysql安装及配置

安装

yum install -y mysql-server mysql mysql-devel。

启动

service mysqld start

设置root

mysqladmin -u root password '881512'

mysql -u root -p

添加数据库

create database if not exists cff default character set utf8;

添加用户并授权

create user cff IDENTIFIED by '123456';

GRANT ALL ON cff.* to cff;

grant ALL PRIVILEGES on bussi .* to cff@% identified by "881512";

grant ALL PRIVILEGES on bussi .* to cff@localhost identified by "881512";

grant ALL PRIVILEGES on imdb.* to cff@% identified by "881512";

登录mysql

mysql -u cff -p

查看权限

select * from mysql.user where user='test‘

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

扫码关注云+社区

领取腾讯云代金券