Re: help with mysql db names

2013-04-18 Thread Kapil Karekar
On 19-Apr-2013, at 9:14 AM, Doug  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: MySQL on Mac OS 10.8

2013-04-17 Thread Kapil Karekar
Not a solution but a workaround for " [ERROR] /usr/local/mysql/bin/mysqld: 
Can't create/write to file '/var/run/mysqld/mysqld.pid' "

explicitly set 

pid_file=

to some existing file path in 

/usr/local/mysql/bin/mysqld_safe  (Line:26)


e.g. you could possibly set it to:

pid_file=/usr/local/mysql/data/larry.local.pid


- Kapil Karekar

On 17-Apr-2013, at 8:59 PM, Larry Martell  wrote:

> On Wed, Apr 17, 2013 at 8:32 AM, Reindl Harald  wrote:
>> 
>> 
>> Am 17.04.2013 15:32, schrieb Larry Martell:
>>> On Tue, Apr 16, 2013 at 11:31 AM, Reindl Harald  
>>> wrote:
>>>> Am 16.04.2013 18:34, schrieb Larry Martell:
>>>>> I just set up mysql on Mac OS 10.8. Each time after the machine is
>>>>> rebooted the server fails to start with:
>>>>> 
>>>>> 2013-04-13 14:09:54 1 [ERROR] /usr/local/mysql/bin/mysqld: Can't
>>>>> create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2 - No
>>>>> such file or directory)
>>>>> 
>>>>> Because the /var/run/mysqld dir does not exist. I have to create it
>>>>> manually then the server starts. But I have to do this after each
>>>>> reboot, which is a pain. Anyone know why the /var/run/mysqld dir gets
>>>>> deleted, or how to get around this?
>>>> 
>>>> you need to consult your operating system's documentation
>>>> on linux with systemd it would be the following config
>>>> 
>>>> [root@srv-rhsoft:~]$ cat /etc/tmpfiles.d/mysql.conf
>>>> d /var/run/mysqld 0755 mysql mysql -
>>> 
>>> Doesn't seem to be anything like that running on MacOS. I googled and
>>> didn't find anything. I posted to a mac forum, but haven't received
>>> any responses yet. I'll have to try SO
>> 
>> you need to modify the StartupItem to create the directory
>> before starting mysqld, as said: OS manual
>> 
>> http://dev.mysql.com/doc/mysql-macosx-excerpt/5.5/en/macosx-installation-startupitem.html
> 
> Yes, I have this, but it doesn't work if /var/run/mysqld is not there.
> I still have to manually create that dir after each reboot.
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/mysql
> 


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