debian wheezy 升级后, 由于授权错误, 导致password给改动, 在debian的mysql safe下也无法进入.  

我在/etc/mysql/my.cnf 里面已经改动了bind-address 为局域网ip

进而运行了

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

然后重载授权表:

FLUSH PRIVILEGES;

然后重新启动后, 尽管能够远程链接, 可是debian 本身报了一个mysql的error.

/etc/cron.daily/logrotate:

/usr/bin/mysqladmin: refresh failed; error: 'Unknown error'

error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log '

run-parts: /etc/cron.daily/logrotate exited with return code 1

Saved 4 messages in /home/tom/mbox

这个问题的产生是由于第一次mysql服务启动的时候mysql_safe的error.log日志文件是被root创建的, mysqladmin 调用cron的日志切割清除这个日志文件没有权限导致的.

这个bug已经在新点儿的debian sid里面修复了, 可是stable版本号还没有接到这个fix.

解决的方法:

又一次配置下mysql的error_log , 在my.cnf里面. 而且让你的mysql对这个文件有权限.

-rw-r-----  1 root  adm      517639 [2014-07-01  9:26] mysql_error.log

改动root为mysql 就能够了

chown mysql /var/log/mysql/mysql_error.log

对于centos6,7的远程连接失败问题, 普遍是新装的server

没有root密码的: mysqladmin -uroot password "newpass"

已经有root密码: mysqladmin -uroot password 'oldpasswd' 'newpasswd'

也能够直接登录mysql, mysql -u root;use mysql;UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';FLUSH PRIVILEGES;

丢失password: mysqld_safe --skip-grant-tables& mysql -u root mysql;

UPDATE user SET password=PASSWORD("new password") WHERE user='root'; FLUSH PRIVILEGES;

给用户授权远程訪问, 首先确认端口[client] port=3307 [mysqld] port=3307 其次看mysql是否启动起来, netstat -anp | grep 3307看端口占用

然后grant all privileges on *.* to 'root'@'%' identified by 'your_password' with grant option; FLUSH PRIVILEGES;

防火墙开放3307端口,  iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3307 -j ACCEPT

查看规则是否生效, iptables -L -n

删除老的规则iptables -D INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

同一时候防火墙须要保存service iptables save /etc/init.d/iptables save

或者直接改动vi /etc/sysconfig/iptables 增加

-A INPUT -p tcp -m state --state NEW -m tcp --dport 3307 -j ACCEPT

这样就能够远程登录了.

usr/bin/mysqladmin: refresh failed; error: 'Unknown error'的更多相关文章

  1. 安装mysql报错:Can't find messagefile '/usr/share/mysql/english/errmsg.sys'和/usr/bin/mysqladmin: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or

    使用yum安装mysql服务端: [root@centos ~]# yum -y install mysql-server Loaded plugins: fastestmirror, securit ...

  2. bash:/usr/bin/mogod/:connot execute binary:exec fotmat error

    前两天博主在安装mogodb的时候出现以下错误,很是郁闷,明明按照教程里面做的,怎么到最后 执行命令的时候出错了呢,以下为错误execute binary:exec fotmat error" ...

  3. Promise is rejected: Error: 2 UNKNOWN: error starting container: API error (404): {"message":"network build-blockchain-insurance-app_default not found"}出错的解决方案

    错误描述: docker logs web 现象: > blockchain-for-insurance@2.1.0 serve /app > cross-env NODE_ENV=pro ...

  4. cuda8.0 出错:/usr/bin/ld: 找不到 -lGL【转】

    本文转自:https://blog.csdn.net/u010159842/article/details/56833030 最近在学习深度学习,在搭建CUDA8.0的时候,出现一个非常不好的问题: ...

  5. HTTP Error 500 - Server Error.

    Error Details: The FastCGI process exited unexpectedly Error Number: -1073741819 (0xc0000005). Error ...

  6. Mac 无法安装安装psutil 报错 error: command '/usr/bin/clang' failed with exit status 1

    psutil是一个特别好用来检查系统资源的一个包, 但是 在Mac安装却总是报错 查看监控系统脚本, 点这里 mac系统版本: Macos Mojave 10.14.3 报错信息如下: WARNING ...

  7. xcode编译报错unknown error -1=ffffffffffffffff Command /bin/sh failed with exit code 1

    升级完xcode9.1之后,编译项目出现如下错误: CI今日构建时报出如下错误: /Users/xxx/Library/Developer/Xcode/DerivedData/Snowball-ebl ...

  8. xcodebuild构建时报错unknown error -1=ffffffffffffffff Command /bin/sh failed with exit code 1

    CI今日构建时报出如下错误: /Users/xxx/Library/Developer/Xcode/DerivedData/Snowball-ebllohyukujrncbaldsfojfjxwep/ ...

  9. /usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity on endpoint naughty_wozniak (444e26e0a2a3adb1ff88177ead86099ad64c0406afcec179ce7cfeef8ffa2d5c): (i

    /usr/bin/docker-current: Error response from daemon: driver failed programming external connectivity ...

随机推荐

  1. 重大漏洞:Bitlocker成摆设,多款固态硬盘硬件加密均可被绕过

    荷兰拉德堡德大学的两名研究人员日前发表论文,描述了固态硬盘流行加密软件Bitlocker中的关键漏洞.固态硬盘需要口令来加密和解密其上存储的内容,但该口令可以被绕过. 荷兰拉德堡德大学的两名研究人员日 ...

  2. printf---格式化并输出结果到标准输出。

    printf命令格式化并输出结果到标准输出. 语法 printf(选项)(参数) --help:在线帮助: --version:显示版本信息. 参数 输出格式:指定数据输出时的格式: 输出字符串:指定 ...

  3. 使用Spring Mvc 转发 带着模板 父页面 之解决方法 decorators.xml

    周末了,周一布置的任务还没完毕,卡在了页面跳转上,接手了一个半截的项目要进行开发,之前没有人给培训.全靠自己爬代码,所以进度比較慢.并且加上之前没实用过 Spring Mvc 开发项目.所以有点吃力, ...

  4. CF(438D) The Child and Sequence(线段树)

    题意:对数列有三种操作: Print operation l, r. Picks should write down the value of . Modulo operation l, r, x. ...

  5. HDOJ 5306 Gorgeous Sequence 线段树

    http://www.shuizilong.com/house/archives/hdu-5306-gorgeous-sequence/ Gorgeous Sequence Time Limit: 6 ...

  6. 手动连接数据库(jdbc)

    import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import ...

  7. android 图片特效处理之 图片叠加

    这篇将讲到图片特效处理的图片叠加效果.跟前面一样是对像素点进行处理,可参照前面的android图像处理系列之七--图片涂鸦,水印-图片叠加和android图像处理系列之六--给图片添加边框(下)-图片 ...

  8. hadoop集群环境配置成功与否查看方法

    1.Hadoop启动jobhistoryserver来实现web查看作业的历史运行情况,由于在启动hdfs和Yarn进程之后,jobhistoryserver进程并没有启动,需要手动启动jobhist ...

  9. 图形界面备份Linux系统介绍

    详情见: http://os.51cto.com/art/200905/125680.htm             虽然Linux 是一个高度可靠的操作系统,但对于现在复杂的internet环境下, ...

  10. 初识Oracle中的正则表达式

    Oracle使用正则表达式离不开这4个函数: 1.regexp_like 2.regexp_substr 3.regexp_instr 4.regexp_replace