新环境:
[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)]。
而在之前的一套旧环境中,显示的确实mysql,而MariaDB的版本是一样的,通过which查看mysql的位置,可以确定原因,旧系统中原来默认有安装过mysql,所以遗留了之前的命令。 因为配置过环境变量,直接把旧的mysql文件rm掉,在重新开个窗口,就可以正常显示了。
[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)]>
版权声明:本文为博主原创文章,未经博主允许不得转载。