在CentOS 7上装了MySQL,但是找不到mysql命令
[root@ens33tmp]#servicemysqlstatusSUCCESS!MySQLrunning(3610)[root@ens33tmp]#mysql-uro...
[root@ens33 tmp]# service mysql status
SUCCESS! MySQL running (3610)
[root@ens33 tmp]# mysql -u root -p
-bash: mysql: command not found
[root@ens33 tmp]# rpm -ivh MySQL-server-5.5.57-1.el7.x86_64.rpm
warning: MySQL-server-5.5.57-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
package MySQL-server-5.5.57-1.el7.x86_64 is already installed
[root@ens33 tmp]# mysqld
170719 13:00:28 [Note] mysqld (mysqld 5.5.57) starting as process 4601 ...
170719 13:00:28 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
170719 13:00:28 [ERROR] Aborting
170719 13:00:28 [Note] mysqld: Shutdown complete
[root@ens33 tmp]# rpm -qa |grep mysql
[root@ens33 tmp]# //空白,没结果。好像没有装过…… 展开
SUCCESS! MySQL running (3610)
[root@ens33 tmp]# mysql -u root -p
-bash: mysql: command not found
[root@ens33 tmp]# rpm -ivh MySQL-server-5.5.57-1.el7.x86_64.rpm
warning: MySQL-server-5.5.57-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
package MySQL-server-5.5.57-1.el7.x86_64 is already installed
[root@ens33 tmp]# mysqld
170719 13:00:28 [Note] mysqld (mysqld 5.5.57) starting as process 4601 ...
170719 13:00:28 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
170719 13:00:28 [ERROR] Aborting
170719 13:00:28 [Note] mysqld: Shutdown complete
[root@ens33 tmp]# rpm -qa |grep mysql
[root@ens33 tmp]# //空白,没结果。好像没有装过…… 展开
1个回答
展开全部
1、mysql一般存放在/usr/local/mysql/bin
2、也可以将/usr/local/mysql/bin添加到PATH环境变量,例如
在~/.bash_profile增加
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
export PATH
3、重新登陆或者执行source ~/.bash_profile让变量生效
env|grep PATH
4、执行mysql -uroot -p测试即可
5、或者cd /usr/local/mysql/bin执行
./mysql -uroot -p
2、也可以将/usr/local/mysql/bin添加到PATH环境变量,例如
在~/.bash_profile增加
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin
export PATH
3、重新登陆或者执行source ~/.bash_profile让变量生效
env|grep PATH
4、执行mysql -uroot -p测试即可
5、或者cd /usr/local/mysql/bin执行
./mysql -uroot -p
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询