mysql -uroot -P4040

Asked by Javadev

i install mysql-proxy using

yum install mysql-proxy

mysql-proxy-0.8.0-1.fc13.i686 installed version on fedora 13
my proxy.cnf file is

[mysql-proxy]
daemon = true
keepalive = true

pid-file=/var/run/mysql-proxy.pid
log-file=/var/log/mysql-proxy/mysql-proxy.log
log-level=debug
proxy-address=localhost:3307
proxy-backend-addresses=dbmaster:3306,dbsalve:3306
lua-path=/usr/lib/mysql-proxy/lua/proxy/*.lua
admin-lua-script=/usr/lib/mysql-proxy/lua/proxy/admin-1.lua
proxy-lua-script=/usr/lib/mysql-proxy/lua/proxy/reporter.lua

start mysql-proxy using

mysql-proxy --defaults-file=/etc/init.d/mysql-proxy.cnf

netstat -lnp | grep mysql
tcp 0 0 0.0.0.0:4041 0.0.0.0:* LISTEN 19925/mysql-proxy
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 20073/mysqld
tcp 0 0 127.0.0.1:3307 0.0.0.0:* LISTEN 19925/mysql-proxy
unix 2 [ ACC ] STREAM LISTENING 246109 20073/mysqld /var/lib/mysql/mysql.sock

i logged in mysql using
mysql -uroot -ptestroot -P4040

and run show querycounter, show proxy processlist..

but getting error msg
mysql> show querycounter;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'querycounter' at line 1
mysql>

Pls. help me how use mysql-proxy

Thanks in Advance

Question information

Language:
English Edit question
Status:
Solved
For:
MySQL Proxy Edit question
Assignee:
No assignee Edit question
Solved by:
Javadev
Solved:
Last query:
Last reply:
Revision history for this message
fmpwizard (diego-fmpwizard) said :
#1

Hi,

on your cnf file you have

proxy-address=localhost:3307

but you then try to connect to port 4040, so you may be connecting to
the wrong proxy instance.

if this was just a typo, the debug log should have some more
information, most likely there wasw a problem loading the lua script.

Let me know if this helps

Revision history for this message
Javadev (prafulkvaja) said :
#2

Hello,

I used proxy-address=localhost:3307 & 127.0.01:3307

logged in mysql using
mysql -uroot -ptestroot -P3307 -hlocalhost

mysql -uroot -ptestroot -P3307 -h127.0.0.1

mysql> show querycounter;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'querycounter' at line 1
mysql>

Here path & cpath for LUA

[root@adserver lua]# pwd
/usr/lib/mysql-proxy/lua
[root@adserver lua]# ll
total 196
-rw-r--r-- 1 root root 5774 Aug 7 11:25 admin-1.lua
-rw-r--r-- 1 root root 6653 Aug 7 11:25 auto-config.lua
-rw-r--r-- 1 root root 1737 Aug 7 11:25 balance.lua
-rwxr-xr-x 1 root root 10084 Feb 1 2010 chassis.so
-rw-r--r-- 1 root root 3575 Aug 7 11:25 commands.lua
-rwxr-xr-x 1 root root 4256 Feb 1 2010 glib2.so
-rwxr-xr-x 1 root root 12008 Feb 1 2010 lfs.so
-rwxr-xr-x 1 root root 35280 Feb 1 2010 lpeg.so
-rwxr-xr-x 1 root root 62556 Feb 1 2010 mysql.so
-rw-r--r-- 1 root root 5157 Aug 7 11:25 parser.lua
-rwxr-xr-x 1 root root 4608 Feb 1 2010 posix.so
drwxr-xr-x 2 root root 4096 Aug 6 16:48 proxy
-rw-r--r-- 1 root root 2510 Aug 7 11:25 reporter.lua
-rw-r--r-- 1 root root 6164 Aug 7 11:25 test.lua
-rw-r--r-- 1 root root 5913 Aug 7 11:25 tokenizer.lua

Pls. guide us where is problem
Thanks in advance

Revision history for this message
Javadev (prafulkvaja) said :
#3

Here mysql-proxy status

[root@adserver lua]# mysql-proxy -V
mysql-proxy 0.8.0
  glib2: 2.23.2
  libevent: 1.4.13-stable
  lua: Lua 5.1.4
    LUA_PATH: /usr/lib/mysql-proxy/lua/?.lua
    LUA_CPATH: /usr/lib/mysql-proxy/lua/?.so
  == plugins ==
  admin: 0.7.0
  proxy: 0.7.0

Revision history for this message
fmpwizard (diego-fmpwizard) said :
#4

Hi

> I used proxy-address=localhost:3307 & 127.0.01:3307

Only use proxy-address=127.0.01:3307

and

mysql -uroot -ptestroot -P3307 -h127.0.0.1 to log in

using -hlocalhost tells the mysql client to ignore the port number and
it uses a socket to connect to mysql, so it will ignore the proxy.

Please post the contents of this file

/var/log/mysql-proxy/mysql-proxy.log

Thanks

  -Diego

>
> logged in mysql using
> mysql -uroot -ptestroot -P3307 -hlocalhost
>
> mysql -uroot -ptestroot -P3307 -h127.0.0.1
>

>
> mysql> show querycounter;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'querycounter' at line 1
> mysql>
>
> Here path & cpath for LUA
>
> [root@adserver lua]# pwd
> /usr/lib/mysql-proxy/lua
> [root@adserver lua]# ll
> total 196
> -rw-r--r-- 1 root root  5774 Aug  7 11:25 admin-1.lua
> -rw-r--r-- 1 root root  6653 Aug  7 11:25 auto-config.lua
> -rw-r--r-- 1 root root  1737 Aug  7 11:25 balance.lua
> -rwxr-xr-x 1 root root 10084 Feb  1  2010 chassis.so
> -rw-r--r-- 1 root root  3575 Aug  7 11:25 commands.lua
> -rwxr-xr-x 1 root root  4256 Feb  1  2010 glib2.so
> -rwxr-xr-x 1 root root 12008 Feb  1  2010 lfs.so
> -rwxr-xr-x 1 root root 35280 Feb  1  2010 lpeg.so
> -rwxr-xr-x 1 root root 62556 Feb  1  2010 mysql.so
> -rw-r--r-- 1 root root  5157 Aug  7 11:25 parser.lua
> -rwxr-xr-x 1 root root  4608 Feb  1  2010 posix.so
> drwxr-xr-x 2 root root  4096 Aug  6 16:48 proxy
> -rw-r--r-- 1 root root  2510 Aug  7 11:25 reporter.lua
> -rw-r--r-- 1 root root  6164 Aug  7 11:25 test.lua
> -rw-r--r-- 1 root root  5913 Aug  7 11:25 tokenizer.lua
>
> Pls. guide us where is problem
> Thanks in advance
>
> You received this question notification because you are a direct
> subscriber of the question.
>

--
Diego Medina
Web Developer
http://www.fmpwizard.com

Revision history for this message
Javadev (prafulkvaja) said :
#5

Hi

I use only proxy-address=127.0.01:3307, see
mysql-proxy log

2010-08-09 11:13:27: (message) mysql-proxy 0.8.0 started
2010-08-09 11:13:27: (debug) chassis-limits.c:75: current RLIMIT_NOFILE = 1024 (hard: 1024)
2010-08-09 11:13:27: (debug) chassis-limits.c:79: trying to set new RLIMIT_NOFILE = 8192 (hard: 1024)
2010-08-09 11:13:27: (critical) chassis-limits.c:81: could not raise RLIMIT_NOFILE to 8192, Invalid argument (22). Current limit still 1024.
2010-08-09 11:13:27: (message) proxy listening on port 127.0.0.1:3307
2010-08-09 11:13:27: (message) added read/write backend: dbmaster:3306
2010-08-09 11:13:27: (message) added read/write backend: dbsalve:3306
2010-08-09 11:15:47: (debug) abs wait-for-event::done usec= 0
2010-08-09 11:15:47: (debug) abs lua-exec::done usec= 0

Revision history for this message
Javadev (prafulkvaja) said :
#6

Issue solved .. my self

Revision history for this message
fmpwizard (diego-fmpwizard) said :
#7

so now it all works ?

On Wed, Aug 11, 2010 at 8:58 AM, Javadev
<email address hidden> wrote:
> Question #120180 on MySQL Proxy changed:
> https://answers.launchpad.net/mysql-proxy/+question/120180
>
>    Status: Open => Solved
>
> Javadev confirmed that the question is solved:
> Issue solved .. my self
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>

--
Diego Medina
Web Developer
http://www.fmpwizard.com