# MySQL screwing up!!



## Thrillseeker TS (Jan 10, 2004)

I installed MySQL about a month or 2 ago, right after I got Panther, and last night I set up phpBB and made the forums all prettyful. Then I was watching a video that I downloaded, and the WMV file caused my computer to hang. While trying to bring up the Force Quit menu, I accidentally force restarted it. After it rebooted, I wasn't able to go to the boards; there was an error saying it couldn't connect to the MySQL database. I went into Terminal to try and start it up again, but got this error:


```
/usr/local/mysql/bin/mysqladmin
/usr/local/mysql/bin/mysqladmin  Ver 8.40 Distrib 4.0.16, for apple-darwin6.6 on powerpc
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Administration program for the mysqld daemon.
Usage: /usr/local/mysql/bin/mysqladmin [OPTIONS] command command....
  {commands not important now}

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- -----------------------------
count                             0
force                             FALSE
compress                          FALSE
character-sets-dir                (No default value)
host                              (No default value)
port                              0
relative                          FALSE
socket                            (No default value)
sleep                             0
user                              (No default value)
verbose                           FALSE
vertical                          FALSE
connect_timeout                   43200
shutdown_timeout                  3600

Default options are read from the following files in the given order:
/etc/my.cnf /usr/local/mysql/data/my.cnf ~/.my.cnf 
The following groups are read: mysqladmin client

{codes taken out}

[Mustang:~] ericpete% /usr/local/mysql/bin/mysql -u root -p
Enter password: 
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
```


----------



## btoneill (Jan 10, 2004)

Is mysqld running?

Brian


----------



## Thrillseeker TS (Jan 10, 2004)

No, it's not. But every time I go to try and start it up, I get an error saying I don't have permission to do so. I had version 4.0.16, but I upgraded to 4.1.1 about an hour ago to see if it solved the problem. Alas, it did not  

[EDIT] Tried it again.


```
Last login: Sat Jan 10 20:36:10 on console
Welcome to Darwin!
[Mustang:~] ericpete% /usr/local/mysql/bin/mysqld
/usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/mysql/data/' (Errcode: 13)
040110 21:20:12  Aborting

040110 21:20:12  /usr/local/mysql/bin/mysqld: Shutdown Complete

[Mustang:~] ericpete% /usr/local/mysql
tcsh: /usr/local/mysql: Permission denied.
[Mustang:~] ericpete% /usr/local/mysql -u root -p
tcsh: /usr/local/mysql: Permission denied.
[Mustang:~] ericpete% /usr/local/mysql/bin/mysqld -u root
/usr/local/mysql/bin/mysqld: Can't change dir to '/usr/local/mysql/data/' (Errcode: 13)
040110 21:21:07  Aborting

040110 21:21:07  /usr/local/mysql/bin/mysqld: Shutdown Complete
```


----------



## btoneill (Jan 10, 2004)

Well, first of all /usr/local/mysql is a directory, and you keep trying to run it as a command. Try this:


```
cd /usr/local/mysql
sudo ls bin/mysqld_safe
sudo ./bin/mysqld_safe &
```

This should start mysqld for you. The first sudo line is just to make sure you are authenticated with sudo so the 2nd one when you run ./bin/mysqld_safe does not ask you for a password again.

Brian


----------



## Thrillseeker TS (Jan 10, 2004)

```
[Mustang:~] ericpete% cd /usr/local/mysql
[Mustang:/usr/local/mysql] ericpete% sudo ls bin/mysqld_safe
bin/mysqld_safe
[Mustang:/usr/local/mysql] ericpete% sudo ./bin/mysqld_safe &
[1] 540
[Mustang:/usr/local/mysql] ericpete% Starting mysqld daemon with databases from /usr/local/mysql/data
040110 23:00:10  mysqld ended
```


```
[Mustang:/usr/local/mysql] ericpete% /usr/local/mysql/bin/mysql -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
```


----------



## btoneill (Jan 10, 2004)

You need to look in the mysqld log files. Right after mysqld starts, it stops, something should show up in there. they should be in /usr/local/mysql/var.

Brian


----------

