ubuntu 18服务器安装mysql_ubuntu 18.04安装mysql及常见问题处理

安装Mysql并配置

$ sudo apt-get install mysql-server    #    查看是否运行$ ps aux | grep mysql

接下来配置mysql的密码和权限问题

sudo mysql_secure_installation

1.是否安装密码校验插件VALIDATE PASSWORD PLUGIN can be used to test passwords......选择n

2.设置密码Please set the password for root here.New password:xxxxxxRe-enter new password:xxxxxx

3.删除匿名用户(生产环境有必要删除)By default, a MySQL installation has an anonymous user......选择y

4.是否允许root用户远程登录Normally, root should only be allowed to connect from‘localhost'. ......选择y

5.是否删除“测试”库By default, MySQL comes with a database named ‘test' thatanyone can access. This is also intended only for testing,......选择y

6.是否立即生效Reloading the privilege tables will ensure that all changes......选择y

配置完mysql后,把bind-address注释掉,使得本机以外的ip都能连接进来:

$ sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf# 把这一行注释上  # bind-address 127.0.0.1  # 保存退出!wq

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值