频道栏目
首页 > 资讯 > Linux > 正文

centos 7 mariadb

17-08-25        来源:[db:作者]  
收藏   我要投稿

服务无法启动.删除 mariadb,mariadb-server. 删除 /var/lib/mysql 和 /etc/my.cnf 重新安装
开机启动
systemctl enable mariadb
服务启动
systemctl start mariadb
(status restart stop)
初始化:
mysql_secure_installation
之后按照提示操作
开放端口:
firewall-cmd –zone=public –add-port=3306/tcp –permanent
firewall-cmd –reload
链接:
mysql -h host -u user -P port -p
创建用户:
insert into mysql.user(Host,User,Password) values(“localhost”,”test”,password(“1234”));
授权:
grant select,delete,update,create,drop on . to test@”%” identified by “1234”;
grant select,update on testDB.* to test@localhost identified by ‘1234’;
刷新系统权限表:
 flush privileges;
utf8:
vi /etc/my.cnf

[mysqld]
character-set-server = utf8
collation-server = utf8_general_ci
skip-character-set-client-handshake

其他:
show databases;
use xxx;
show tables;

相关TAG标签
上一篇:MongoDB和MySQL的区别
下一篇:大数据量时Mysql的优化要点
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站