mysql
发布时间 2023-06-12 00:46:34作者: rbcd
yum安装mysql
yum install mysql-server -y yum安装
service mysqld start 启动mysql的服务
chkconfig mysqld on 将mysql服务设置成开机启动
mysql 进入到mysql的命令行
在mysql命令行修改mysql密码
--切换数据库
use mysql
--查看表
show tables
--查看表的数据
select host,user,password from user;
--插入权限数据
grant all privileges on *.* to 'root'@'%' identified by '123' with grant option
--删除本机的用户访问权限(可以执行也可以不执行)
delete from user where host!='%'
--刷新权限或者重启mysqld的服务
service mysqld restart; --(重启mysql服务)
flush privileges; --(刷新权限)