基于鲲鹏服务器CentOS 7中使用Yum安装Mariadb数据库

详细地址操作 https://bbs.huaweicloud.com/blogs/244673

安装mariadb数据库

yum -y install mariadb mariadb-server

启动数据库服务

service mariadb start

查看运行状态

service mariadb status

设置密码

mysqladmin password # 修改密码mysqladmin -p password

登录数据库

mysql -uroot -p

create user ‘qgs’@’%’ identified by ‘qgs111’; #create user ‘用户名’@’%’ identified by ‘密码’;
grant select,process,super on . to ‘qgs’@’%’ identified by ‘qgs111’; #grant select,process,super on . to ‘用户名’@’%’ identified by ‘密码’; 允许所有ip连接(用通配符%表示),只允许指定IP地址链接将%去掉即可
flush privileges;
create database qgs_db default character set ‘utf8’; #创建名称为“ aqgs_db”的数据库
grant all privileges on qgs_db.* to ‘qgs’@‘localhost’; #将库“ qgs_db”的所有权限授予用户“ qgs”
flush privileges;
quit

上一篇:java.sql.SQLException: Access denied for user 'gaoqi'@'127.0.0.1' (using passwor


下一篇:远程连接MySql