This is a discussion on Error with MySql Query Browser within the MySQL forums, part of the Database Server Software category; --> Hi guys, I'm new to this ng and to mysql, too. I'm using mysql under ubuntu (a linux distribution) ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi guys, I'm new to this ng and to mysql, too. I'm using mysql under ubuntu (a linux distribution) and I'm geting following error when I run mysql query browser: ================================================ Could not connect to host 'localhost'. MySQL Error Nr. 2002 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) ================================================ A little history. Mysql.sock wasn't on my system so I tried to create one with touch, chmod and chown to obtain 'mysql.sock 0 -rwxrwxrwx' but it didn't worked. I copied /var/run/mysqld/mysqld.sock to /var/lib/mysql/mysql.sock, but I always get the above error. What have I to do to have mysql browser working? Thank you in advance |
| |||
| "Alfred N." <human.being@pillow.us> wrote: > I'm geting > following error when I run mysql query browser: > ================================================ > Could not connect to host 'localhost'. > MySQL Error Nr. 2002 > Can't connect to local MySQL server through socket > '/var/lib/mysql/mysql.sock' (111) > ================================================ > > A little history. Mysql.sock wasn't on my system so I tried to create > one with touch, chmod and chown to obtain 'mysql.sock 0 -rwxrwxrwx' but > it didn't worked. No surprise. This is a socket, not a file. It is created by the MySQL server (the mysqld process). No need to create or delete it. > I copied /var/run/mysqld/mysqld.sock to > /var/lib/mysql/mysql.sock, but I always get the above error. No surprise as well. You cannot 'copy' a socket. But if it exists in /var/run/mysql (seems to be Ubuntu specific) then clearly the Query Browser won't find it in /var/lib/mysql. Seems your MySQL is Ubuntu- ized, but your Query Browser isn't. > What have I to do to have mysql browser working? Does your mysql package come with a my.cnf? (dpkg -L mysql-server) A standard MySQL client program reads /etc/my.cnf (and ~/.my.cnf) and evaluates the [client] section. So you could start by creating a file ~/.my.cnf and put the following into it: [client] socket = /var/run/mysqld/mysqld.sock A better solution would be to have a complete my.cnf in /etc. Possibly Ubuntu has /etc/mysql/my.cnf. Then you could symlink that into /etc. XL -- Axel Schwenke, Senior Software Developer, MySQL AB Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/ MySQL User Forums: http://forums.mysql.com/ |
| ||||
| Axel Schwenke ha scritto il 10/01/2006 02:32 PM: > A standard MySQL client program reads /etc/my.cnf (and ~/.my.cnf) and > evaluates the [client] section. So you could start by creating a file > ~/.my.cnf and put the following into it: > > [client] > socket = /var/run/mysqld/mysqld.sock > > A better solution would be to have a complete my.cnf in /etc. Possibly > Ubuntu has /etc/mysql/my.cnf. Then you could symlink that into /etc. > Ahem...another piece of history :-) I have mysql-query-browser in /opt/mysql-gui-tools-5.0 together with mysql-administrator and mysql-workbench. Since administrator and workbench are ok, I ran browser from that directory and it never worked. I made modifications you suggested but browser again didn't work! I gave another glance at my.cnf to discover basedir=/usr. I take a trip inside that dir to discover a terrible truth :-) In /usr/bin there are all mysqlxxxxxx files and one of them is mysql-query-browser. I run it and magically everything was ok. Then I've discovered another interesting tool: mysql-navigator and it works too! :-) Thank you for your patience and your suggestions! |