avatar
MySQL: cannot connect# Database - 数据库
m*e
1
Something like the following when I run mysql client:
MySQL Connection Failed: Can't connect to local MySQL server
through socket '/tmp/mysql.sock' (2)
Does it mean it's not correctly configured?
avatar
a*i
2

Did you install mysql server?
Did you start the server?? I dont remember the details.. (again), but
IIRC, there are some steps you need to follow when you start mysql
server first time.

【在 m*****e 的大作中提到】
: Something like the following when I run mysql client:
: MySQL Connection Failed: Can't connect to local MySQL server
: through socket '/tmp/mysql.sock' (2)
: Does it mean it's not correctly configured?

avatar
m*e
3

but
The server has been running as root, and I am not root...

【在 a*****i 的大作中提到】
:
: Did you install mysql server?
: Did you start the server?? I dont remember the details.. (again), but
: IIRC, there are some steps you need to follow when you start mysql
: server first time.

avatar
a*i
4
hmm soit is already installed?
what mysql client did you get?

【在 m*****e 的大作中提到】
:
: but
: The server has been running as root, and I am not root...

avatar
m*e
5

(again),
mysql
Just the script named mysql.

【在 a*****i 的大作中提到】
: hmm soit is already installed?
: what mysql client did you get?

avatar
m*e
6
Faint, I have to run mysql -h hostname even if I am local.
avatar
m*i
7
the mysql unix socket is default to /var/lib/mysql/mysql.sock
try to create a link to it in /tmp

【在 m*****e 的大作中提到】
: Something like the following when I run mysql client:
: MySQL Connection Failed: Can't connect to local MySQL server
: through socket '/tmp/mysql.sock' (2)
: Does it mean it's not correctly configured?

avatar
a*s
8
Haha, the same problem as me.
Strange thing is that even the localhost and root is added to
the user table, when I run something need to create a database,
it still gives me permission error, so I have to
put "%","root" into user table, and it works.

【在 m*****e 的大作中提到】
: Faint, I have to run mysql -h hostname even if I am local.
avatar
d*o
9

^^^^^^^^^^^^
No surprise it works. But be careful, this is dangerous!!!
Of course if you just play around, you have nothing to lose, but that is
not a good practice, especially considering you learn this stuff for
more important things later on.

【在 a****s 的大作中提到】
: Haha, the same problem as me.
: Strange thing is that even the localhost and root is added to
: the user table, when I run something need to create a database,
: it still gives me permission error, so I have to
: put "%","root" into user table, and it works.

avatar
a*s
10
I have deleted "%","root", and I found that I can still
create database now. something strange, anyway, I'm a beginner.

【在 d*o 的大作中提到】
:
: ^^^^^^^^^^^^
: No surprise it works. But be careful, this is dangerous!!!
: Of course if you just play around, you have nothing to lose, but that is
: not a good practice, especially considering you learn this stuff for
: more important things later on.

avatar
n*e
11
你编译的时候没有指定路径.

【在 m*****e 的大作中提到】
: Something like the following when I run mysql client:
: MySQL Connection Failed: Can't connect to local MySQL server
: through socket '/tmp/mysql.sock' (2)
: Does it mean it's not correctly configured?

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。