mysql基础命令


一.MYSQL安装

# yum -y install epel-release

# yum -y install wget

 # yum -y install mysql-community-server mysql

二.MYSQL基础操作

# systemctl restart mysqld

# grep 'password' /var/log/mysqld.log

# mysql -uroot -p'password'

>alter user 'root'@'localhost' identified by 'password';

>\q

>create database shiyu character set utf8 collate utf8_bin;

>show databases;

>grant select,insert,updata,delete,create,drop,alter,index on *.* to 'shiyu'@'localhost' identified by 'password';

>flush privileges;

>show grant for 'shiyu'@'localhost';

# systemctl enable mysqld