linux查看登入mysql,如何登录mysql并从linux终端查询数据库

I am using debian linux.

I have a linux machine on which mysql is install.

I can log in to my linux machine using root user as well as other user.

I can connect to mysql database on linux machine from windows machine using sqlyog.

Now I want to execute queries on linux machine only using linux terminal

I tried some following things on terminal

I went to root directory then I went to /var/lib directory

I run following commands on terminal

mysqladmin -u root -p

mysqladmin -u root -ppassword

everytime I have get following error message

ERROR 1045 (28000) Access denied for

user 'root'@'localhost' (Using

password NO)

please guide me for following

How do I get mysql prompt in linux terminal?

How I stop the mysql server from linux terminal?

How I start the mysql server from linux terminal?

How do I get mysql prompt in linux terminal?

How do I login to mysql server from linux terminal?

How do I solve following error?

ERROR 1045 (28000) Access denied for

user 'root'@'localhost' (Using

password NO)

Please give me solutions for above question.

Thank You

解决方案

1.- How do I get mysql prompt in linux terminal?

mysql -u root -p

At the Enter password: prompt, well, enter root's password :)

You can find further reference by typing mysql --help or at the online manual.

2. How I stop the mysql server from linux terminal?

It depends. Red Hat based distros have the service command:

service mysqld stop

Other distros require to call the init script directly:

/etc/init.d/mysqld stop

3. How I start the mysql server from linux terminal?

Same as #2, but with start.

4. How do I get mysql prompt in linux terminal?

Same as #1.

5. How do I login to mysql server from linux terminal?

Same as #1.

6. How do I solve following error?

Same as #1.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值