签到成功

知道了

CNDBA社区CNDBA社区

MariaDB mysql 登录后显示为 Mysql 的解决方法

2018-02-11 10:38 7254 0 原创 MySQL
作者: dave

新环境:http://www.cndba.cn/dave/article/2656http://www.cndba.cn/dave/article/2656http://www.cndba.cn/dave/article/2656

http://www.cndba.cn/dave/article/2656
http://www.cndba.cn/dave/article/2656

[root@MariaDB mysql]# which mysql
/usr/local/mysql/bin/mysql
[root@MariaDB mysql]#
[root@MariaDB mysql]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or /g.
Your MariaDB connection id is 16
Server version: 10.2.12-MariaDB-log MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> use mysql
Database changed
MariaDB [mysql]>

注意登录mysql后显示的名称是MariaDB [(none)]。 http://www.cndba.cn/dave/article/2656http://www.cndba.cn/dave/article/2656

http://www.cndba.cn/dave/article/2656
http://www.cndba.cn/dave/article/2656

而在之前的一套旧环境中,显示的确实mysql,而MariaDB的版本是一样的,通过which查看mysql的位置,可以确定原因,旧系统中原来默认有安装过mysql,所以遗留了之前的命令。 因为配置过环境变量,直接把旧的mysql文件rm掉,在重新开个窗口,就可以正常显示了。 http://www.cndba.cn/dave/article/2656

[root@www.cndba.cn/dave ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or /g.
Your MySQL connection id is 53
Server version: 5.5.5-10.2.12-MariaDB-log MariaDB Server

Copyright (c) 2000, 2013, 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> 
mysql> exit
Bye
[root@www.cndba.cn/dave ~]# which mysql
/usr/bin/mysql
[root@www.cndba.cn/dave ~]# rm -rf /usr/bin/mysql

[root@www.cndba.cn/dave ~]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or /g.
Your MariaDB connection id is 54
Server version: 10.2.12-MariaDB-log MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]>

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2296
    原创
  • 3
    翻译
  • 582
    转载
  • 198
    评论
  • 访问:8501367次
  • 积分:4477
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ