终端mysql 打不开了_无法从终端启动MySQL

bd96500e110b49cbb3cd949968f18be7.png

I am quite new to the Macintosh, I have Mac OS 10.6 installed.

I downloaded the mysql-5.4.3-beta-osx10.5-x86.dmg file and installed all the files properly.

I have got MySQL server started in system preferences.

Now I want to access MySQL from the terminal but I am unable to do it.

I have tried mysql -u root.

It shows "-bash: mysql: command not found".

How can I make it work?

Is there any tool like phpMyAdmin for Mac?

解决方案

It sounds like you have a path problem in the current shell. Some steps to check/do are:

Can you get to the MySQL prompt from the installed location ? Let's assume that you have installed MySQL in /usr/local/mysql. Then if you change directory (cd /usr/local/mysql/bin) you should be able to execute the mysql command: ./mysql

Check the path settings via env command in your current shell. What you are looking for is the value of PATH where you want to have something along the lines of:

PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin..... with some reference to mysql's installled path

Reset your current path to include /usr/local/bin. This can be done in the instance of the current shell via export PATH=/usr/local/mysql/bin:/usr/local/bin:$PATH

Test that you can then access the mysql binary from any path on your system.

In terms of the tools for accessing MySQL you can take a look at:

- SequelPro

- MySQL Tools

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值