目录
一、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
报错原因
服务器磁盘满啦
解决方法
删除不必要的日志文件或者增加磁盘
-
扩容磁盘
-
清除日志文件
四、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