WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: mysql error message  (Read 3829 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
mysql error message
« on: January 05, 2009, 01:56:23 PM »
I'm getting closer. I've been moving my web server over to TC little by little. As a side note I have discovered that I can use the TC opt directory in dsl 4.4 with just a few menu error messages on boot. This is good because I can switch back and forth between TC and DSL quickly. The opt directory has the complete lamp web server in it. I now have apache running fine but my phpbb3 installation won't run in TC. I get the following error message:

SQL ERROR [ mysqli ]

Can't connect to local MySQL server through socket '/opt/lampp/var/mysql/mysql.sock' (2) [2002]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

It runs fine in DSL. Any ideas?
big pc man

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: mysql error message
« Reply #1 on: January 05, 2009, 02:40:43 PM »
Did you try anything yet?  An example search result: http://ubuntuforums.org/archive/index.php/t-276470.html

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: mysql error message
« Reply #2 on: January 05, 2009, 08:37:02 PM »
Thanks for the link. As is the case with many others in the thread the problem is that the sock file is not being created. It looks like a permissions problem to me. But the sql server service is running as root so what can prevent it from creating the sock file.

I have been trying to discover the difference between stock dsl 4.4 and tc. DSl 4.4 using the exact same opt/lampp directory runs fine. All web applications work. In tc the sock file is not created and other problems like the lang file can't be created. it's as if /opt/lampp/var is not writeable by mysqlserver root user service.

edit: I'm beginning to think something is going wrong with bash since it is the common denominator in the failure to create all the mysql temporary files. I wonder if somehow it is running as the wrong user or with the wrong permissions.
« Last Edit: January 06, 2009, 05:28:05 AM by bigpcman »
big pc man

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: mysql error message
« Reply #3 on: January 06, 2009, 07:40:22 AM »
Well I've tried the obvious stuff as suggested in the help thread.
bind address 127.0.0.1 in my.cnf
server name 127.0.0.1 in httpd.conf
created the mysql.sock file manually with changed owership.

None of that fixed the problem.

I did notice that many (most alll) of the files in the lampp directory that are supposed to be user nobody group staff are changed to user 65534. This could be the root of the problem. When I boot up in dsl these same files are user nobody group staff which is what apache expects.

I'm running out of ideas here folks any help would be appreciated.
big pc man

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: mysql error message
« Reply #4 on: January 06, 2009, 10:32:48 AM »
Did you try to create the group?

It may be better to get a version just for TC though...

note: moving this thread since it doesn't have to do with the base

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: mysql error message
« Reply #5 on: January 06, 2009, 01:55:09 PM »
I'm finally making some progress again. I decided rather than trying to get my web server working on tc to instead go back to good old xampp. I downloaded xampp and tried to install it with the usual tar command "tar xvfz xampp-linux-1.7.tar.gz -C /opt". This syntax did not work so I used "tar -C "/opt" -zxf "xampp-linux-1.7.tar.gz". Don't know why the old syntax doesn't work but that's a problem for another day. I should also note that the -v option was rejected as file not found. Anyway, xampp installed fine but had all the same problems - no sock file and  mysql file access permission problems. So I decided to do a brute force test and changed the entire lampp directory recursively to user nobody and group staff with permissions set to 777. I then had to set lampp/bin back to 755 and my.cnf to 755. Once this was done apache, mysql, php and proftp all worked correctly.   

My humble conclusion is that there is something going on in tc (ash?) with both the cp and tar commands regarding maintaining permissions that prevents all the permissions from being maintained. I've used both commands as user tc and user root. I would have thought the root user would have worked.

Now comes the hard part, tracking down exactly what files and directories have the wrong permissions.
big pc man

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: mysql error message
« Reply #6 on: January 06, 2009, 02:06:22 PM »
My humble conclusion is that there is something going on in tc (ash?) with both the cp and tar commands regarding maintaining permissions that prevents all the permissions from being maintained. I've used both commands as user tc and user root. I would have thought the root user would have worked.

if all your problems seem to come from busybox's ash, have you tried simply installing bash as a tce?

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: mysql error message
« Reply #7 on: January 06, 2009, 02:22:50 PM »
I have bash loaded as an extension but I don't know how to make it the default shell. Also, I'm not sure that the ash shell is the problem. Although I do know now that the "lamp kit" scripts require bash. What are other people seeing in this regard?
big pc man

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: mysql error message
« Reply #8 on: January 06, 2009, 03:18:18 PM »
It should keep the permission if the user is allowed to do so - try it again with root privileges.  As for cp, the same applies, but you'll probably also need to specify other switches, such as "-a".

It looks like the busybox tar needs to have the 'f' switch at the end, as anything after that is taken as the input filename.  `tar zxvf somefile.tar.gz ` should work.

cp and tar are (usually) not part of shell builtins, but you can invoke "/bin/bash" to get the bash shell, or change the symlink /bin/sh to point to /bin/bash to have it used for all sh scripts.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: mysql error message
« Reply #9 on: January 06, 2009, 05:58:33 PM »
Could you offer any ideas as to why "tar -C "/opt" -zxf "xampp-linux-1.7.tar.gz" did not maintain permissions. I executed this command in aterm after performing sudo su. If tar is not part of "builtin shell commands then does bash have anything to do with the tar program in tc (assuming the extension is installed)?
« Last Edit: January 06, 2009, 06:01:53 PM by bigpcman »
big pc man

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: mysql error message [problem found]
« Reply #10 on: January 07, 2009, 12:01:17 PM »
Ok, I finally made some progress! Guess what it's not the cp or tar commands causing problems - big surprise. Oh well you live and learn. The xampp package helped me track down the problem to this:

In dsl the lamp startup script when executed from  the terminal as su activates the apache server and mysql server. Both are started up with the Uid root. Subsequently several other httpd instantiations are activated as Uid nobody (server user name). In tc the mysql server is started up with the Uid nobody - the server user name. The key point is that the entire lamp directory permission structure expects that the mysql server is running under the root user not the nobody user. I think this is the way it's suppose to work. To get it to work in tc I had to hunt down all the files with the wrong permissions and change them.  I suppose the correct solution is to get the mysql server to startup under root. I don't know much about scripts ( I know I should by now) so I'm not sure why tc and dsl execute the script differently.

I've attached the lampp script. It's straight out of the xampp 1.6.8a package.

edit: Actually it's a little more complicated as can be seen in the screen shots below. The mysql server is started twice once in safe mode.
« Last Edit: January 07, 2009, 01:27:14 PM by bigpcman »
big pc man