mysql 命令
2023-06-04 本文已影响0人
Newzer
开机与关机
mysql.server start
mysql.server status
chkconfig --add mysqld 加入自启动列表
chkconfig --list 查看自启动列表
mysql.server stop
mysqladmin -uroot -ppass shutdown
连接相关
create user 'chen1'@'localhost' identified by 'pass' 创建本地连接用户chen,密码为pass
create user 'chen2'@'%' identified by 'pass' 创建远程用户
alter user 'chen1'@'localhost' identified by 'pass2' 修改密码为pass2
grant all on . to 'chen1'@'localhost' 授权
flush privileges 刷新
基本操作
create database db1
use db1
show databases
drop database db2