博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu 环境 MySQL的疑难问题解决
阅读量:7058 次
发布时间:2019-06-28

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

前置条件

  1. ubuntu 16.04
  2. mysql-server-5.7

安装步骤

apt-get updateapt-get installl mysql-server-5.7复制代码

对于出现的提示选择 y 就好 ,然后输入root密码。安装完成


操作使用

  1. 远程连接mysql
mysql -h IP -P port -u root -pmysql -h 127.0.0.1 -P 3306 -u root复制代码

以下内容为转载

1.https://www.cnblogs.com/xujishou/p/6306765.html(MySQL5.7 添加用户、删除用户与授权)


疑难问题解决 (后续更新)

1.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
复现root@itlvgo:~# mysqlERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)root@itlvgo:~# mysql -urootERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)复制代码

恩。原因是因为需要输入输入密码的命令,少输入了一个-p using password:NO 正确操作如下

root@itlvgo:~# mysql -uroot -pEnter password: Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 14Server version: 5.7.22-0ubuntu0.16.04.1 (Ubuntu)Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> 复制代码
2.配置用户无法外网访问(本地可以)
/etc/mysql/mysql.conf.d配置如下信息port=3306// 原来的注释掉,默认127.0.0.1bind-address=0.0.0.0复制代码

如果还不可以,进行下面的检查操作

  1. 检查一下是否有开启防火墙;(云服务器的安全组配置)
  2. 如果开启不想关闭,需要开放mysql的占用端口,默认3306;
  3. 关闭防火墙。。

转载于:https://juejin.im/post/5b3c5b0be51d4519146291be

你可能感兴趣的文章
数据仓库的基本特征
查看>>
Flash基础知识详细教程接龙2
查看>>
linux下安装python
查看>>
centos 安装百度云/百度网盘Python客户端
查看>>
mysql事务未提交导致锁等待如何解决
查看>>
Oracle Datagurad Failover
查看>>
linux中lamp的搭建论坛博客
查看>>
创建linux虚拟机
查看>>
V 1 集群相关概念及LVS(LB)
查看>>
一个经典实用的iptables shell脚本
查看>>
java实现截屏功能
查看>>
if test
查看>>
早起秘籍
查看>>
容器领域的十大监控系统对比(下)
查看>>
大师的错误?UNP1中raw socket不能接收TCP和UDP的错误
查看>>
11g DataGuad正确修改sys密码的方法
查看>>
Vmware12 u盘启动系统
查看>>
zabbix自带模板监控MySQL服务
查看>>
Ansible之七:Playbook常用模块
查看>>
玩转树莓派——管理 Windows IoT 设备
查看>>