版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_36827957/article/details/82181482
Linux系统中MySQL启动成功但是通过mysql命令无法进入客户端
报错:
The program ‘mysql’ can be found in the following packages:
* mysql-client-core-5.7
* mariadb-client-core-10.0
Try: apt-get install <selected package>
其实这并不是说MySQL没有安装成功,而是你打开的方式不对而已
是因为编译安装mysql的
解决方案一:
mysql/bin目录没有添加到path里面
所以要cd 到mysql/bin目录下然后 ./mysql -uroot -p密码
解决方案二:
修改/etc/profile文件,在文件末尾添加
PATH=/usr/local/mysql/bin:$PATH
export PATH
关闭文件,运行下面的命令,让配置立即生效
source /etc/profile