Doubt with sored procedures - II

2013-04-18 Thread Antonio Fernández Pérez
I have discovered that in MySQL client program I can define definer and
sql security. This is the detail.

Thanks everybody.

Best regards,

Antonio.


Re: logging in using host alias not working

2013-04-18 Thread Larry Martell
Found the problem. There was cached DNS info on the host. Restarted
nscd and then it worked.

On Thu, Apr 18, 2013 at 10:59 AM, Larry Martell larry.mart...@gmail.com wrote:
 We use host aliases to connect to MySQL all the time, never had an
 issue before. Today we added a new alias, and we cannot connect to the
 server using that one alias but only when we are on the local machine.

 Here is the NIS entry for this host:

 # ypmatch -k ubshp2 hosts
 ubshp2 192.132.2.143ubshp2.predict.com ubshp2 ti-us-dev
 intradb-au-qa intradb-us-alpha intradb-us-dev ti-test-dr
 intradb-test-dr

 I can connect from all these aliases, except intradb-test-dr when I am
 on ubshp2, e.g.:

 From ubshp2 using the intradb-us-dev alias, works:

 ti-test-dr@ubshp2: mysql -h intradb-us-dev -u tradeinfra -p 
 intradb_test_dr
 Welcome to the MySQL monitor.  Commands end with ; or \g.

 From ubshp2 using the intradb-au-qa alias, works:

 ti-test-dr@ubshp2: mysql -h intradb-au-qa  -u tradeinfra -p 
 intradb_test_dr
 Welcome to the MySQL monitor.  Commands end with ; or \g.

 From ubshp2 using the intradb-test-dr alias, does not work:

 ti-test-dr@ubshp2: mysql -h intradb-test-dr -u tradeinfra -p 
 intradb_test_dr
 ERROR 1045 (28000): Access denied for user
 'tradeinfra'@'ubshp2.predict.com' (using password: YES)

 But from a different host using the intradb-test-dr alias, works:

 ti-test-dr@hades: mysql -h intradb-test-dr -u tradeinfra -p 
 intradb_test_dr
 Welcome to the MySQL monitor.  Commands end with ; or \g.

 Anyone have any ideas as to why this one is not working? I've been
 messing with this for 2 days. Nothing in the error log. I've dropped
 and re-added the user, I've bounced the server, I've removed and
 re-added the alias. I've googled and googled and found nothing.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



logging in using host alias not working

2013-04-18 Thread Larry Martell
We use host aliases to connect to MySQL all the time, never had an
issue before. Today we added a new alias, and we cannot connect to the
server using that one alias but only when we are on the local machine.

Here is the NIS entry for this host:

# ypmatch -k ubshp2 hosts
ubshp2 192.132.2.143ubshp2.predict.com ubshp2 ti-us-dev
intradb-au-qa intradb-us-alpha intradb-us-dev ti-test-dr
intradb-test-dr

I can connect from all these aliases, except intradb-test-dr when I am
on ubshp2, e.g.:

From ubshp2 using the intradb-us-dev alias, works:

ti-test-dr@ubshp2: mysql -h intradb-us-dev -u tradeinfra -p intradb_test_dr
Welcome to the MySQL monitor.  Commands end with ; or \g.

From ubshp2 using the intradb-au-qa alias, works:

ti-test-dr@ubshp2: mysql -h intradb-au-qa  -u tradeinfra -p intradb_test_dr
Welcome to the MySQL monitor.  Commands end with ; or \g.

From ubshp2 using the intradb-test-dr alias, does not work:

ti-test-dr@ubshp2: mysql -h intradb-test-dr -u tradeinfra -p intradb_test_dr
ERROR 1045 (28000): Access denied for user
'tradeinfra'@'ubshp2.predict.com' (using password: YES)

But from a different host using the intradb-test-dr alias, works:

ti-test-dr@hades: mysql -h intradb-test-dr -u tradeinfra -p intradb_test_dr
Welcome to the MySQL monitor.  Commands end with ; or \g.

Anyone have any ideas as to why this one is not working? I've been
messing with this for 2 days. Nothing in the error log. I've dropped
and re-added the user, I've bounced the server, I've removed and
re-added the alias. I've googled and googled and found nothing.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: help with mysql db names

2013-04-18 Thread Kapil Karekar
On 19-Apr-2013, at 9:14 AM, Doug d...@hacks.perl.sh wrote:

 why these db names created fail but the last one gets success?
 
 mysql create database 3208e1c6aa32;
 mysql create database 208e1c6aa32;
 mysql create database 08e1c6aa32;
 mysql create database 8e1c6aa32;

These are not working because MySQL is interpreting the database names as 
expressions. Look closely at the db names:

3208e+1
208e+1
08e+1
8e+1

 mysql create database e1c6aa32;
 Query OK, 1 row affected (0.01 sec)

This works fine.

Suggestion:

Don't use database names starting with integers unless you use back ticks. 

This will work for you: 

mysql create database `3208e1c6aa32`;

Though I would recommend not using such names. Some poor guy working on your 
application six months down the line is going to wonder why his queries are 
failing, spend a day trying to figure out and will post the same question again 
to this list :-)

Cheers!
Kapil Karekar

Managing Director @ Ask DB Experts
http://www.askdbexperts.com


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: help with mysql db names

2013-04-18 Thread Keith Keller
On 2013-04-19, Doug d...@hacks.perl.sh wrote:

 why these db names created fail but the last one gets success?

[snips]

 mysql create database 3208e1c6aa32;
 mysql create database 208e1c6aa32;
 mysql create database 08e1c6aa32;
 mysql create database 8e1c6aa32;
 mysql create database e1c6aa32;

https://dev.mysql.com/doc/refman/5.5/en/identifiers.html

You could try quoting your db names and see if you have any more
success.

--keith

-- 
kkel...@wombat.san-francisco.ca.us



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



help with mysql db names

2013-04-18 Thread Doug
Hello,

why these db names created fail but the last one gets success?

mysql create database 3208e1c6aa32;
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 '3208e1c6aa32' at line 1

mysql create database 208e1c6aa32;
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 '208e1c6aa32' at line 1

mysql create database 08e1c6aa32;
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 '08e1c6aa32' at line 1

mysql create database 8e1c6aa32;
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 '8e1c6aa32' at line 1

mysql create database e1c6aa32;
Query OK, 1 row affected (0.01 sec)

mysql select version();
++
| version()  |
++
| 5.5.16-log |
++
1 row in set (0.00 sec)



Thanks a lot!

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql