Navicat connection with a database error problem solving

A,: 1130-host ... is not allowed to connect to this MySql server how to deal with

 First encountered this problem on the server where treated with mysql connection

  1, the connection server: mysql -u root -p

  2, look at all the current databases: show databases;

  3, enter the mysql database: use mysql;

  4, to see all the tables in the mysql database: show tables;

Of which: with grant option is to have permission to cascade to other authorized users

all privileges on *. * permissions

Two, ERROR 2002 (HY000): of Can not Connect to local MySQL Server through socket '/ var MySQL will not start

ps -A | grep -i mysql

kill processes listed

service mysql start

My problem is solved

----------------------------------------------

Fedora8 start mysql error:
ERROR 2002 (HY000): of Can not Connect to local MySQL Server through socket '/var/lib/mysql/mysql.sock' (2)

1, first check /etc/rc.d/init.d / mysqld status to see if mysql has been launched.
Also see if it is a permissions problem.

2. determine your mysql.sock are not in that position,
mysql mysql -u your username -p -S / var / lib / mysql /mysql.sock

. 3, try: Start-Service mysqld

. 4, if authority, permission to change the first MySQL -R & lt #chown: MySQL / var / lib / MySQL

[the root @ localhost ~] # /etc/init.d/ mysqld start
start MySQL: [OK]
[root @ localhost ~] # MySQL-uroot--p

ERROR 2002 (HY000): of Can not Connect to local MySQL Server through socket '/var/lib/mysql/mysql.sock' (2 )
the reason is that access issues / var / lib / mysql's.

shell> chown -R mysql: mysql / var / lib / mysql

then start the server

shell> /etc/init.d/mysql start

the server starts the normal viewing / var / lib / mysql mysql.sock automatically generated file.

But my question remains unresolved.

Finally solved the problem:
Method: Review /etc/my.conf:
[mysqld] 
DATADIR = / usr / local / MySQL / Data 
Socket = / var / lib / MySQL / mysql.sock 

[the mysql.server] 
User = MySQL 
the basedir = / usr / local / MySQL 

the If there IS Not Currently A sectionTop Called [Client], the Add One AT The bottom of The File and Copy The Socket = Line an under The [mysqld] sectionTop SUCH AS: 

[Client] 
Socket = / var / lib / mysql / mysql.sock 

found that still the case, being given the run /etc/init.d/mysql start: Starting MySQLCouldn't find MySQL manager or server 
is the mysqld service did not start, run / usr / local / mysql / bin / mysqld_safe &

My solution is to re-profile [client] module adds
the socket = / var / lib / mysql / mysql.sock

Restart the service, troubleshooting.

Three, Lost connection to MySQL server at 'reading initial communication packet', system error: 0 Problem Solving

Solution is in my.cnf under

Add to       

After the restart the service

 

 

 

 

Published 51 original articles · won praise 9 · views 40000 +

Guess you like

Origin blog.csdn.net/weixin_39891030/article/details/89333654