Installing mysql:sudo launchctl: command not found

I have run into an obstacle. See error message below **
I am Running:
'Mountain lion' , 'Mac OS X 10.8.3'
I have downloaded:
MySQL version. Mac OS X 10.7. (X86, 64-bit), DMG Archive.
After several days of reading about:
Installation of MySQL
Enabling apache server
And getting phpMyAdmin up

I found two sets of instructions: link1 and link2 about installing

apache, phpMyAdm and mySQL.

Link1.
i keep getting errors that i have 5+ urls in this message. i just deleted link1.
it is under 'apple forum discussions doc-3082'

Where this sentence lead me to believe I could use the version listed above.
There is NO version for 10.8
" Download MySQL from a local mirror. You want the Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive. At the time of writing this User Tip, the current version is 5.5.34. By the time you read this, there may be a newer version to use instead. Open the archive mysql-5.5.34-osx10.6-x86_64.dmg. "

I followed the instructions on link1, and all went well until getting this error message when I type the following command at the terminal prompt:

launchctl load -w /comdotmysql.mysql.plist

**Error message
-bash: launchctl: command not found.
  1. I cd - changed directories all the way back up the file structure to type the command to see if it needed to be run someplace special but the same error came up.
  2. I searched here on this forum and on the web.
  3. I went back and checked over every step and everything that i typed.
  4. I ended up typing the instructions below by hand
    because somewhere I read that a copy/paste may insert invisible characters.

Excerpt from link1.

sudo vi /Library/LaunchDaemons/comdotmysql.mysql.plist

Use the following content:

<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>comdotmysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/mysql/bin/mysqld_safe</string>
    <string>--user=mysql</string>
    </array>
  </dict>
</plist>

Can someone please explain what I am missing ?

Why is this command


-bash: launchctl: command not found.

That is launch c t lowercase L not number 1
****
someone suggested that i echo the path....

From the first prompt:

computerName:~<shortname$> echo "${PATH}"
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

It has been a while since I have been navigating around at a unix prompt.

That looks like the path is too long.

Can you interpret the above path for me if it is not too much trouble ?

An added note.

The following link2 also had a very nice set of instructions but unlike link1, this link uses the
'Preference pane' and 'startup item' which link1 discourages because it causes problems down the road.
I would rather use the command line and do not want to give up on this method.

The forum only allow for one url but if you search the below you will find link2 if you are interested. It seems like a good site but I do not want to mess up my system or file structure installing and configuring a bunch of things.
Link2. the coolestguidesontheplanet install-configure- apache-mysql-php-phpmyadmin

Now that I am going head strong with this project, I hope that my issue can be resolved quickly with this community
so I don't loose my momentum.
Thanks a lot.

I would start be wondering what is it that is not found...
like

which launchctl

and if that gives nothing start to look for the damn beast using find command

Hi.
1.
As you suggested I did a 'find launchctl' all the way up the tree.

MacBookPro:httpd shortname$ cd ..
MacBookPro:share shortname$ find launchctl
find: launchctl: No such file or directory
MacBookPro:share shortname$ cd ..
MacBookPro:usr shortname$ find launchctl
find: launchctl: No such file or directory
MacBookPro:usr shortnamel$ cd ..
MacBookPro:/ shortname$ find launchctl
find: launchctl: No such file or directory

Then I just looked in the directories and found the below.
launchctl (is not a directory) found in bin.

MacBookPro:bin shortname$ ls
[        csh        echo        ksh        mkdir        rcp        stty        wait4path
bash        date        ed        launchctl    mv        rm        sync        zsh
cat        dd        expr        link        pax        rmdir        tcsh
chmod        df        hostname    ln        ps        sh        test
cp        domainname    kill        ls        pwd        sleep        unlink

I did find this.

MacBookPro:library shortname$ cd launchdaemons

MacBookPro:launchdaemons shortname$ ls

com.adobe.SwitchBoard.plist        com.mysql.mysql.plist
com.adobe.fpsaud.plist            com.oracle.java.Helper-Tool.plist

I think but not certain that mysql needs to launch from com.mysql.mysql.plist.
I tried to run the code

launchctl load -w /comdotmysql.mysql.plistfrom the launchdaemons directory and 
same error -bash launchctl command not found

thanks for responding quickly.
i want to understand this stuff
thanks again.

Pity Im at work... my Mac is at home...
I am puzzled by you answer, did you type which launchctl ?
If that produces nothing (understand - Return nothing - you can test with another command like ls to see...) then I, as a paranoid would go to root and search for it:

cd /
find / -name launctl -print 

then check all occurence to see what they are...
Once found the one required, check if executable and why its not in the PATH environment variable
Would set it and see if now things og better...

Thanks. I know that you are helping me in between things. I appreciate that.
It is also hard to decipher these bit long responses. I am trying to get right back but it takes time to run code and copy/paste here in some sort of organized manner.

I had typed

Find launchctl

as the command. See last post.

Then did what you said to do.

Macbookpro:/ shortname$  which launchctl
 /bin/launchctl

I again tried the same thing. the command from bin directory.

launchctl load -w /com.mysql.mysql.plist

Same error:
-bash: launchctl: command not found.

If you look above in my previous post in the code boxes, you will see that I had already located one launchctl in the bin directory by navigating around.

I looked around

MacBookPro:library shortname$ cd launchdaemons
MacBookPro:launchdaemons shortname$ ls
com.adobe.SwitchBoard.plist        com.mysql.mysql.plist
com.adobe.fpsaud.plist            com.oracle.java.Helper-Tool.plist

and looked inside of com.mysql.mysql.plist.

Big Mistake.
When I cut and pasted the code from the setup site, I had extra code
which I deleted. It was something like

sudo vi  /Library/LaunchDaemons/com.mysql.mysql.plist.

Not really certain but I think that may have caused the
launchctl command not found

i rebooted terminal and executed the command again from
top of tree
and
from bin
Getting a different error message.

MacBookPro:/ shortname$ sudo launchctl load -w /com.mysql.mysql.plist
launchctl: Couldn't stat("/com.mysql.mysql.plist"): No such file or directory
nothing found to load

MacBookPro:/ shortname$ cd bin
MacBookPro:bin shortname$ sudo launchctl load -w /com.mysql.mysql.plist
Password:
launchctl: Couldn't stat("/com.mysql.mysql.plist"): No such file or directory
nothing found to load

It's the executable launchctl. yes ?
If it is not a directory.

You seem like a systems person.... Lucky you
Me heading in as root.... I am a little brave but not yet.
But as mentioned, I like to understand the system and files and look around hence not using the GUI installs.

I am serious about learning (relearning) this stuff.

At this point just want to get MySQL and phpMyAdmin up and running.
I will be at this all day.
Thanks again,

---------- Post updated at 12:40 PM ---------- Previous update was at 12:01 PM ----------

still troubleshooting this.

MacBookPro:launchdaemons shortname$ sudo launchctl load -w -F com.mysql.myswl.plist
launchctl: Couldn't stat("com.mysql.myswl.plist"): No such file or directory
nothing found to load

but it is there !

MacBookPro:launchdaemons shortnamel$ ls
com.adobe.SwitchBoard.plist        com.mysql.mysql.plist
com.adobe.fpsaud.plist            com.oracle.java.Helper-Tool.plist

the contents of com.mysql.mysql.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<string>--user=mysql</string>
</array>
</dict>

is this line okay ?
<string>com.mysql.mysqld</string>

is this line of code okay ?
<string>com.mysql.mysqld</string>
it is exactly from the setup instructions.
thanks again.

My guess, is launchctl is executable but for root only... so you will have to use sudo...Now command line : since you edited:

sudo vi  /Library/LaunchDaemons/com.mysql.mysql.plis

I believe the command then should be:

sudo launchctl load -w -F  /Library/LaunchDaemons/com.mysql.mysql.plis

But I have no idea what your optins (-w -F) are for.. I am not a Mac person...

Sorry for not going over the rest of your post, but i want to concentrate on this small part of your problem:

First, Unix is CASE-SENSITIVE! If someone asks you to run "find" and you type "Find" chances are you will have no success at all (if you are lucky) or run something completely different without noticing (if you are unlucky). In Unix, "Find" and "find" are two completely different things. The same goes for every other file, command, directory, ...

Second: the "find" command is used differently and the way you used it (even if you have used "find", not "Find") would not have found anything. If you do not know how to use a command use the "man"-pages. For any command "command", type

man command

and for a keyword "keyword" type

man -k keyword
apropos keyword

The two forms are alternatives. Use either one and get a list of articles like the following (from a AIX v5.3 system, your output may look slightly different):

# apropos config
adfutil(1)      - Provides the capability to merge Micro Channel information[...]
autoconf6(1)    - Automatically configures IPv6 network interfaces at boot time.
autopush(1)     - Configures lists of automatically pushed STREAMS modules.
bootptodhcp(1)  - To convert a BOOTP configuration file into a DHCPconfiguration [...]
[....]

The numbers in the brackets are chapter numbers, the names are keywords. You could now, for instance, do a

man 1 adfutil

to get information about the "adfutil"-command. I suggest you do a "man find" (you can also issue "man man" to learn how to use "man" itself) and learn how to use "find".

I hope this helps.

bakunin

1 Like

There ya go.
launchctl will happily unload "com.mysql.mysql.plist" because, well, it's loaded, but you have to specify the path in order to load it.
Since "/com.mysql.mysql.plist" doesn't exist, you get an error message.
"/Library/LaunchDaemons/com.mysql.mysql.plist" does exist.

The manual load and unload isn't strictly necessary unless you want to do that.
On startup, launchctl will load the plist files appropriately (if they are not flagged as disabled).

LaunchDaemons run whether anyone is logged in or not. LaunchAgents will load at user logins.

1 Like

Thanks for the reminder to use the man.

Still working on it.

---------- Post updated at 06:00 PM ---------- Previous update was at 05:58 PM ----------

Thanks vib.

Replying to these posts is a bit weird.

I cannot see the entire thread and click respond to each person individually.

Still working on this and making progress.

---------- Post updated 02-13-14 at 04:19 PM ---------- Previous update was 02-12-14 at 06:00 PM ----------

I spent hours today navigating around using terminal.
Looking at directory structures and opening up files.
Things are clearing up but still not confident.
Just want to say thanks again.

I feel sorry for you because I can guess you are struggling... On my Mac laptop I use at home only for safari (browser to come here) or write scripts or show young students what is unix and what are the firsts commands to know including vi, I therefore rarely need to be root but have configured configured sudoers accordingly to my needs hehe ( oh and I go terminal when want to do some change in kernel...), my advice would be to go through command line as a user and learn properly unix commands and vi ( the editor...) before trying to do software configs through command line because what you see in command line not the same as what Mac shows you in GUI...
Its so true I created a user the unix way on my laptop and when testing, seen it doesnt show up in the GUI, but if I open a terminal and login, it works and we are 2 on the lappy... I never bothered getting the thing put right because of lack of time and have other priorities... but I know how confusing it can be... So get your soft installed by GUI and go after to look what has changed and look how, you will then have the key to understanding for future installs, perhaps in command line...
Good Luck

Yes. This did help.

I am still a little bit all over the place.
Navigating in UNIX.
Installing apache, phpMyAdmin and MySQL.
Using phpMyAdmin the last few days.

Still jumping back into the .conf files and .ini files to explore and understand.
It is fun but as I said, still a bunch of missing pieces in the puzzle.

Do you know anything about phpMyAdmin ?
I am using syntax as such:

$_SERVER

and although I am getting output in my browser, I am only getting

::1 

Rather than 127,0,0,1

Just thought that I would ask.

Again. Thanks for the code to get specific help.

hmmm... scratches head .... PHP .... ist that something to eat? ;-))

You probably mean "127.0.0.1" rather than "127,0,0,1" (notice the "." instead of ","). "127.0.0.1" is the so-called "loopback address" in IP v4, while "::1" is the same in IP v6 (or "IPng", as it is alternatively called).

You probably need to activate some "IP v4 only" or something such option in your configuration.

I hope this helps.

bakunin

1 Like

Sorry, I read your response and used it to troubleshoot. I thought that I had sent along a thanks and that it was helpful.

I cannot seem to find an easy way to find my own posts when I logon to this forum. Do you know how to navigate from the menus ?

Yes: from the top menu select "User CP" and select "Subscribed Threads" from the drop-down. All threads you write to (or open yourself) will be automatically subscribed, so you can find all your postings from there.

Alternatively, go to "Advanced Search" and search for all posts under your user name.

I hope this helps.

bakunin

Hi Again.

This came up again today. ::1.

In my /etc/hosts

## # Host Database 
# # localhost is used to configure the loopback interface 
# when the system is booting. 
Do not change this entry.
 ## 127.0.0.1 localhost 
255.255.255.255  broadcasthost 
::1 localhost

It says DO NOT CHANGE THIS ENTRY.

The code I am running is checking ip addresses and then blocking one.
The problem is that the language construct die(); does Not Kill the page.
The HTML 'welcome' text still shows.
It is again just a learning exercise so I am echoing and killing the page at certain points to see what shows up on the browser. The following code should die() and not show the word 'welcome' coded between HTML tags but it does show up.

Index.php

<?php 
require 'conf.inc.php';
foreach($ip_blocked as $ip){
    if ($ip==$ip_address){
     die();
}
}
?>
<h1> welcome</h1>

conf.inc.php

<?php 
$ip_address = $_SERVER['REMOTE_ADDR'];
$ip_blocked = array('127.0.0.1', '100.100.100.100');
?>

I added this code - someone suggested this and I was helpful although I do NOT fully understand how to interpret.

$ip_address = $_SERVER['REMOTE_ADDR']; 
$ip_blocked = array('100.100.100.100'); 
var_dump($ip_blocked); 
var_dump($ip_address); 

Output: I typed this in.

array(2) { [0]=> string(9)  "127.0.0.1" [ 1] => string(15) "100.100.100.100" } string(3) "::1"  "::1"

see that ::1.... i had that question a while back.
when I use this code....

foreach($ip_blocked as $ip) { 
echo $ip.'<br>';

i get this output:

127.0.0.1 100.100.100.100 

not ::1

I am confused.
Is this why I am running into trouble with my testing ?

Any clarification will be helpful.
Thanks again.

OK, very short introduction to networking basics:

"IP" is the basis for all internet communication (hence the name, "Internet Protocol"). For some aspects of this protocol it is necessary that a host can communicate with itself, just like it would be another host (like you look at yourself in the mirror). For this there is a special address, which does not belong to a certain host at all, but to each host: 127.0.0.1. This is called the "loopback" address every host can use this to connect internally to itself.

So far, so good. Alas, the classical IP (which, in fact, is "IP v4") is getting to its limits in many ways. One of the aspects where IP (v4) is starting to experience problems is the address room: the classical 4-byte address is simply not providing enough numbering space to accomodate for all the devices needing to access the internet (which needs a unique IP address as a prerequisite). Therefore IP v6 (or "IPng - next generation"; don't ask what happened to v5) provides a much bigger address space. In this new address space "::1" is the new loopback address.

I suppose you need to either deactivate IP v6 somewhere and/or activate "IP v4 only" to get rid of the "::1", because most probably PHP, as a network-aware language, automatically translates "127.0.0.1" to "::1" back and forth.

I know this won't help you in finding the problem directly, but at least you should now know what to look for and why.

I hope this helps.

bakunin

Thanks again bakunin !
Very helpful again.
You clarifications are definitely is filling in some of the pieces to this puzzle for me.