首先登陆数据库没有问题呀,但是有报错,
文本显示:
ERROR 1193 (HY000) at line 84: Unknown system variable 'have_csv'
ERROR 1064 (42000) at line 86: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
ERROR 1243 (HY000) at line 87: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 88: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE
ERROR 1193 (HY000) at line 92: Unknown system variable 'have_csv'
ERROR 1064 (42000) at line 94: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
ERROR 1243 (HY000) at line 95: Unknown prepared statement handler (stmt) given to EXECUTE
ERROR 1243 (HY000) at line 96: Unknown prepared statement handler (stmt) given to DEALLOCATE PREPARE
大致问题:一个未知的变量 在查看,没有明白
查看master.err 错误日志
2018-11-16 19:07:21 86997 [ERROR] Column count of performance_schema.events_waits_current is wrong. Expected 19, found 16. The table is probably corrupted
2018-11-16 19:07:21 86997 [ERROR] Column count of performance_schema.events_waits_history is wrong. Expected 19, found 16. The table is probably corrupted
2018-11-16 19:07:21 86997 [ERROR] Column count of performance_schema.events_waits_history_long is wrong. Expected 19, found 16. The table is probably corrupted
在查看使用mysql --version 输出为
mysql Ver 14.14 Distrib 5.5.11, for Linux (x86_64) using EditLine wrapper
在数据库里面查看 mysql version()
+------------+
| version() |
+------------+
| 5.6.42-log |
+------------+
感觉有点奇怪呀,为什么出现这样的现象,输出不一致
首先查看 .bash_profile 查看没有 奇怪了
使用 which mysql
/application/mysql/bin/mysql
在一看 这个目录下对mysql 做了个软连接 指向的是5.5 的MySQL包下面对bin,突然明白了,为什么出现这个问题
直接在.bash_profile 中添加变量
source .bash_profile
使用命令 mysql --version
mysql Ver 14.14 Distrib 5.6.42, for linux-glibc2.12 (x86_64) using EditLine wrapper
这下对了 ,在使用
root@master ~]# mysql_upgrade -uroot -pzgs
Warning: Using a password on the command line interface can be insecure.
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
Warning: Using a password on the command line interface can be insecure.
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
Running 'mysql_fix_privilege_tables'...
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
Warning: Using a password on the command line interface can be insecure.
test.ii OK
test.level OK
test.mm OK
test.nn OK
test.pp OK
test.qq OK
test.sc OK
test.test OK
test.uu OK
test.yy OK
test.zz OK
OK
升级成功 。
这下明白了
在说一个小坑 ,在后来查看mysql 的path写在了 /etc/profile
导致我第一时间查看.bash_profile 没有查看到问题的原因
同时百度了一下 它们俩的执行顺序
/etc/profile ->/etc/enviroment -->HOME/.profile−−>HOME/.profile−−>HOME/.env
所以再写path 的时候 还是下载用户的环境变量吧
心里苦呀 想了差不多两天!