博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
创建mysql数据库
阅读量:6737 次
发布时间:2019-06-25

本文共 1232 字,大约阅读时间需要 4 分钟。

centos7参考:http://www.cnblogs.com/starof/p/4680083.html

      mysql-community-release包下载连接:http://files.cnblogs.com/files/amusic/mysql-community-release-el7-5.noarch.zip

以下为centos6环境,

#以下这条命令是解决云模板中的MariaDB与MySQL相关软件包冲突问题

yum remove MariaDB* -y

#安装启动MySQL数据库服务器

yum install mysql-server -y

#

service mysqld start

#设置数据库管理员初始密码为password

mysqladmin -u root password 'password'

#开启防火墙数据库相关端口

iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

service iptables save

#如果使用的是MariaDB,以下命令改为chkconfig mysql on

chkconfig mysqld on

 

使用mysql工具连接失败:

一:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor

 

 更新权限

#登录mysqlmysql -uroot -ppassword#切换数据库>use mysql;>update user set password=password('newpassword') where user='root'; #更新权限>flush privileges;>quit

二:

1130 - host is not allowed to connect to this mysql server

   未开启远程连接  

解决方案:

#使用root登录mysqlmysql -uroot -ppassword>use mysql;#更改user表>update user set host = '%' where user = 'root';#验证结果>select host, user from user;+-----------+------+| host      | user |+-----------+------+| %         | root || 127.0.0.1 | root || centos |      || centos | root || localhost |      |+-----------+------+5 rows in set (0.00 sec)

  

 

转载于:https://www.cnblogs.com/amusic/p/5047598.html

你可能感兴趣的文章
部署PowerBI报表服务器(本地)
查看>>
国内几个php开源代码解析
查看>>
Linux下添加php的zip模块
查看>>
hadoop 命令手册
查看>>
阿里云ECS搭建Java+mysql+tomcat环境的简要步骤
查看>>
我的友情链接
查看>>
win7分区工具——Acronis Disk Director Suite
查看>>
JDK自带VisualVM监控tomcat 内存、CPU
查看>>
final在新的Jmm被重新定义,说说你对它的实现机制的了解?
查看>>
Move VMDK files to different datastores using vSphere web client
查看>>
隔离公司各个部门--虚拟路由器(EBGP)
查看>>
H3C防火墙的dns-map功能
查看>>
iOS 9 点击右上角退回到上一App时 屏幕会闪一下
查看>>
我的友情链接
查看>>
数组与指针(一)
查看>>
I/O模型分类
查看>>
智能照明控制系统
查看>>
Shiro的Demo示例
查看>>
RISC领域ARM不是唯一
查看>>
数据库容灾的最高境界
查看>>