Mysql报错

一、Ignoring query to other database

报错原因

登陆数据库缺少参数

root@localhost ~]# mysql -root -p

错误示例

[root@localhost ~]# mysql -root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.5.48-log Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
Ignoring query to other database
mysql> Ctrl-C -- exit!
Aborted

解决方法

补全的参数,整句话意思是使用root用户去登陆密码为666666

[root@localhost ~]# mysql -uroot -p666666

解决示例

[root@localhost ~]# mysql -uroot -p000000
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost ~]# mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 5.5.48-log Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)

二、2003 - can’t connect to MySQL server on ‘xxxxx’(10060 “Unknown error”)

ssh可以正常登陆,ssh访问通过mysql命令可以进入数据库,使用Navicat连接报错

报错原因

防火墙问题,使用的是oneinstack一键安装工具这个会自己给你安装iptables

解决方法

systemctl stop iptables

三、General error: 1030 Got error 28 from storage engine

报错原因

服务器磁盘满啦

解决方法

删除不必要的日志文件或者增加磁盘

  1. 扩容磁盘

  2. 清除日志文件

四、mysqldump: [Warning] Using a password on the command line interface can be insecure.

报错原因

mysql5.7版本,安全机制做了改变,直接写不行了

解决办法

vi  /etc/my.cnf

[client]
port = 3306
socket = /tmp/mysql.sock
host = 127.0.0.1
user = root
password = password
重新载入配置文件

service mysqld reload
运行命令

/usr/local/mysql/bin/mysqldump --defaults-extra-file=/etc/my.cnf  -R -E -e --all-databases  | gzip > $backupdir/database_$date_str.sql.gz 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值