debian9安装mysql mariadb

debian9下mysql 替换成mariadb-server-10.1

不过两者类似

具体可见 《MySQL和mariadb区别》

http://ask.chinaunix.net/question/556

MySQL之父Widenius先生离开了Sun之后,觉得依靠Sun/Oracle来发展MySQL,实在很不靠谱,于是决定另开分支,这个分支的名字叫做MariaDB。

。。。。。

所以对于大部分的MySQL用户来说,从现在主流的MySQL转到MariaDB应该是没有什么难度的

 

1 su 切换到root账号

apt-get install mysql-server

显示如下(安装完成后 再次运行安装命令的提示 )

# apt-get install mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done

mysql 也就是debian的MariaDB 安装成功

 

 

2 开启服务器 远程ping服务器Ip 发现可ping通

但是无法登陆MariaDB  这是因为没有开启远端访问

默认路径下 /etc/mysql/mariadb.conf.d 开启50-server.cnf

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1

修改为

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1

使用ROOT权限保存文档 服务器可识别除了127.0.0.1 以外的连接

 

3 进入服务器开启远程账号访问

在mysql 下 输入 grant all privileges on *.* to 'root'@'%' identified by 'ROOTpassword' with grant option;

开启远程访问数据库的账号.

 

4 可以进行远程访问了 我这里使用的是navicat 

按照提示设置连接属性即可

posted on 2017-10-19 12:49  itdef  阅读(768)  评论(0编辑  收藏  举报

导航